var projectId = null;
var modelId = null;
var projectData = null;
var planId = null;
var planData = null;
var tabs = [];
var panel = null;
var paramList = [];
var listdata = [];
var listview = null;
var planIds = [];
var treeNode_ ="";
var date_ ="";
var intcont = 0;
var userId = "";
var ICONT_DSED_ENDDAY = 0;
var treeNodeIndex = 0;
var backStageTimer = null;
var tabletimer = null;
function initPage() {
	$(".msgbox").hide()
	$.ajax({
		url: "Sample/getUserId",
		type:'POST',
		cache:false,
		async:false,
		dataType: "json",
		contentType:"application/json",
		success:function(data){
			userId = data.respData;
		}
	});
	var reg = new RegExp("(^|&)projectId=([^&]*)(&|$)", "i");
	var param = window.location.search.substr(1).match(reg);
	if (param != null) {
		projectId = param[2];
	} else {
		return;
	}
	var reg = new RegExp("(^|&)modelId=([^&]*)(&|$)", "i");
	var param = window.location.search.substr(1).match(reg);
	if (param != null) {
		modelId = param[2];
	} else {
		return;
	}
	projectData = getProject(projectId);
	if (!projectData || projectData.error) {
		showMsgBox("获取工程失败！",function(type) {
			return true;
		});
		return;
	}
	planData = getPlanList(projectId);
	if (!planData || planData.error) {
		showMsgBox("获取方案失败！",function(type) {
			return true;
		});
		return;
	}
	treeNodeIndex = planData.length-2;
	window.onContextMenu = onContextMenu;
	window.onmouseover = onMouseOver;
	window.onresize = onResize;

	$("#progressState").loadStep({
		size: "large",
		color: "blue",
		steps: [
			{title: "新能源", content: "可再生能源运行模拟"},
			{title: "水电",content: "长期水电运行模拟"},
			{title: "检修",content: "检修运行模拟"},
			{title: "日运行",content: "逐日运行模拟"},
			{title: "计算结果",content: "导入计算结果"}
		]
	});
	$("#progressState").setStep(1);

	$('.header_exit').click(function(){
		//退出系统
		/*$.ajax({
            url: '../pv/login/logout',
            dataType: 'text'
        }).done(function(res) {
    	});
		window.location.href="../index.html";*/
		window.history.go(-1);
	});
	/*$('#logo').click(function(){
		window.location.href="../index.html";
	});*/
	$('.header_home').click(function(){
		window.location.href = "main.html";
	});

	$('#btnPanel').click(function(){
		$("#inPlanName")[0].setValue("");
		$("#inPlanDemo")[0].setValue("");
		//$('#wizardMask').show();
		$('#planPanel').show();
	});
	$('#btnAddPlan').click(function(){
		$("#inPlanName")[0].setValue("");
		$("#inPlanDemo")[0].setValue("");
		initPlanList();
		$('#wizardMask').show();
		$('#planPanel').show();
	});
	$('#btnCancel').click(function(){
		$('#wizardMask').hide();
		$('#planPanel').hide();
	});
	$('#btnCancelEdit').click(function(){
		$('#wizardMask').hide();
		$('#planPanelEdit').hide();
	});
	$('#btnFinish').click(function(){
		JyyLoading.start();
		$('#wizardMask').hide();
		$('#planPanel').hide();
		$("#inPlanName")[0].clearError();
		var inPlanName = $("#inPlanName")[0].getValue();
		if (RxCommon.isEmpty(inPlanName)) {
			$("#inPlanName")[0].setError("请填写方案名！");
			JyyLoading.end();
			return;
		} /*else if(inPlanName.length > 15) {
			$("#inPlanName")[0].setError("方案名长度超过15！");
			JyyLoading.end();
			return;
		}*/
		var inPlanDemo = $("#inPlanDemo")[0].getValue();
		var inCopyPlanDemo = $('#inCopyPlanDemo').val();
		$.when(createPlan(projectData.id,modelId, inPlanName, inPlanDemo, inCopyPlanDemo)).done(function(result){
			if (!result || result.error) {
				if (result.itemName === "planName") {
					$("#inPlanName")[0].setError("方案名已经存在！");
					return;
				} else {
					showMsgBox("方案工程失败！",function(type) {
						return true;
					});
					return;
				}
			} else {
				planData = getPlanList(projectId);
				treeNodeIndex = planData.length-2;
				loadTreeView();
				showMsgBox("新建方案成功！",function(type) {
					return true;
				});
			}
			JyyLoading.end();
		});

	});

	$('#btnFinishEdit').click(function(){
		$("#inPlanNameEdit")[0].clearError();
		var inPlanName = $("#inPlanNameEdit")[0].getValue();
		var inPlanDemo = $("#inPlanDemoEdit")[0].getValue();
		if (RxCommon.isEmpty(inPlanName)) {
			$("#inPlanNameEdit")[0].setError("请填写方案名！");
			return;
		} /*else if(inPlanName.length > 15) {
			$("#inPlanNameEdit")[0].setError("方案名长度超过15！");
			return;
		}*/
		var inPlanDemo = $("#inPlanDemoEdit")[0].getValue();
		var result = editPlan(planData.id, inPlanName, inPlanDemo);
		if (!result || result.error) {
			if (result.itemName === "planName") {
				$("#inPlanNameEdit")[0].setError("方案名已经存在！");
				return;
			} else {
				showMsgBox("修改方案工程失败！",function(type) {
					return true;
				});
				return;
			}
		} else {
			planData = getPlanList(projectId);
			loadTreeView();
			showMsgBox("修改方案成功！",function(type) {
				return true;
			});
		}
		$('#wizardMask').hide();
		$('#planPanelEdit').hide();
	});

	$('#btnClose').click(function(){
		$('#wizardMask').hide();
		$('#runPanel').hide();
		$('.rxdate').hide();
	});

	$('#btnRoute').click(function(){
	});

	$('#btnMeos').click(function(){
	});

	$('#btnRun').click(function(){
		planIds = [];
		if(intcont>0)paramList[0].DSED_PRECISION = paramList[0].DSED_PRECISION/100;
		planIds.push(planId);
		paramList[0].DSED_ENDDAY = addDate(date_);
		$.ajax({
			async:false,
			url:'work/setParams',
			type:'POST',
			dataType:'json',
			data:{"paramList":JSON.stringify(paramList),"planId":JSON.stringify(planIds)}
		});
		//showProcessBar();

		//展示进度窗口
		$('#progressDiv').show();
		$('#progressDiv').draggable();
		//循环查看状态
		var t = setInterval(function(){
			$.ajax({
				dataType: "json",
				data:{planId:planId},
				url: 'executive/getProgressInfoYX'
			}).done(function(res) {
				var r = eval("("+res.result+")");
				$('#progressStrip').css({width:r.progressBar+"%"});
				$('#progressStrip').find("span").text(r.progressBar + "%");
				$('#progressText').html(r.result);
				$('#progressText')[0].scrollTop = $('#progressText')[0].scrollHeight;
				$("#progressState").setStep(r.progressState);
			});
		}, 1000);
		$('#progressClose').click(function(){

			layui.use('layer', function(){ //独立版的layer无需执行这一句
				var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句

				layer.confirm('选择【终止计算】，将结束计算，【后台计算】可以从进程管理界面查看计算进度。', {
					btn: ['后台计算','终止计算'] //按钮
				}, function(){
					layer.msg('后台计算', {icon: 1});
					$('#progressDiv').hide();
					$('#wizardMask').hide();
				}, function(){
					killNowTask();
					backStageTimer && clearInterval(backStageTimer);
					//tabletimer && clearInterval(tabletimer);
					layer.msg('终止计算', {icon: 1});
					$('#progressDiv').hide();
					$('#wizardMask').hide();
				});
			});
			clearInterval(t);
		});
		$.ajax({
			dataType: "json",
			data:{planId:planId},
			url: "executive/implementExeYX"
		}).done(function(res) {
			/*$.ajax({
				async:false,
				url:'../pv/executive/pPosition',
				type:'POST',
				dataType:'json',
				data:{"planId":planId}
			});*/
			clearInterval(t);
			backStageTimer && clearInterval(backStageTimer);
			//tabletimer && clearInterval(tabletimer);
			$('#progressStrip').css({width:"100%"});
			$('#progressStrip').find("span").text("100%");
			$('#progressText').html(res.result);
			$('#progressText')[0].scrollTop = $('#progressText')[0].scrollHeight;
			$("#progressState").setStep(5);

			$('#wizardMask').hide();
			$('#progressDiv').hide();

			$('#progressStrip').css({width:"0%"});
			$('#progressStrip').find("span").text("0%");
			$('#progressText').html("");
			$("#progressState").setStep(0);
		}).fail(function(data, status, xhr){
			clearInterval(t);
		});
		refreshProtasktList();
		$('#runPanel').hide();
	});
	$('#btnReturn').click(function(){
		$('#wizardMask').hide();
		$('#runPanel').hide();
	});
	$('#progressListClose').click(function(){
		backStageTimer && clearInterval(backStageTimer);
		tabletimer && clearInterval(tabletimer);
		$('#progressList').hide();
	});

	$('#listqueryH').click(function(){
		refreshProtasktHList();
	});
	$('#listclearH').click(function(){
		$('#H_modelName').val("");
		$('#H_projectName').val("");
		$('#H_planName').val("");
	});
	$('#listquery').click(function(){
		$('#backstageText').html("");
		backStageTimer && clearInterval(backStageTimer);
		tabletimer && clearInterval(tabletimer);
		refreshProtasktList();
	});
	$('#listclear').click(function(){
		$('#L_modelName').val("");
		$('#L_projectName').val("");
		$('#L_planName').val("");
	});
	$('#progressMin').click(function(){
		$('#progressDiv').hide();
		$('#heideProesslist').show();
		$('#heideProesslist').draggable();
	});
	initSystem();
	loadTreeView();
	getParams();
	loadRunPage();
	initCommonEvent();
	onResize();
	projectType = 0;
	projectName = null;
	projectdata = getProjectList('admin', 0, projectType, projectName);
	refreshProtasktList();
	refreshProtasktHList();
}
function initSystem(){
	var sys = '1';
	if(sys=='1'){
		$("#mapGird").css('display','block');
		$("#btnMeos").click();
	}
};
function initPlanList(){
	var sel = $('#inCopyPlanDemo');
	var method ='getCompDatas';
	invoke(method, {userId:userId,modelId:modelId}, function(data){
		var content = '';
		sel.empty();
		$.each(data.respData.compData,function(i,n){
			if(i == 0 || (i!=0 && n.projectId!=data.respData.compData[i-1].projectId)) {
				if(i!=0){
					content += "</optgroup>";
				}
				content += "<optgroup label='" + n.projectName + "'>";
			}
			content += "<option value='" + n.planCode + "'>"+ n.planName+"</option>";
		});
		sel.append("<option value=''>-</option>"+content+"</optgroup>");
		sel.selectpicker('refresh');

	});
};


function onResize() {
	console.log("onResize");
	resizeAddPlanPage();
	resizeRunPage();
};
function onMouseOver(e) {
	var event = e || window.event;
	var target = event.target;
	if (target.id == "headerMenu") {
		$("#treePanel")[0].style.visibility = "visible";
	} else {
		var treeNode = $(target).parents("#treePanel");
		if(target.id){
			if (target.id == "treePanel" || treeNode && treeNode.length > 0 || target.id == "mouseDiv" || target.parentElement.id== "mouseDiv" ) {
				if(target.parentElement.id== "mouseDiv"|| target.id == "mouseDiv"){

				}else{
					$("#mouseDiv").css('display','none')

				}
			} else {
				$("#mouseDiv").css('display','none')
				$("#treePanel")[0].style.visibility = "hidden";
			}
		}
	}
	if(target.className =="gopt_tab_panel"  ){
		$(".rxdate")[0].style.display = "none"; $(".rxdate")[1].style.display = "none";
	}

};
function onContextMenu (e,id){
	if(!e)return;
	var clintX=e.clientX;
	var clintY=e.clientY;
	var scollTop=document.documentElement.scrollTop|| document.body.scrollTop;
	var scollLeft=document.documentElement.scrollLeft || document.body.scrollLeft
	var el=document.getElementById('mouseDiv');
	el.style.left=clintX+scollLeft+'px';
	el.style.top=clintY+scollTop+'px';
	el.style.display='block';
	document.getElementById("mouseDiv").onclick=function(res){
		el.style.display='none';
		var name ='';
		var demo ='';
		for (var i = 0; i < planData.length; i++) {
			if(planData[i].id==id){
				name = planData[i].name;
				demo = planData[i].demo;
			}
		}
		if(res.target.textContent=="修改方案"){

			$("#inPlanNameEdit")[0].setValue(name);
			$("#inPlanDemoEdit")[0].setValue(demo);
			$('#wizardMask').show();
			$('#planPanelEdit').show();
		}
		if(res.target.textContent=="删除方案"){
			$("#wizardMask").show();
			showConfirmMsgBox("确定要删除该方案吗？", function(type) {
				$('#wizardMask').hide();
				if(type == "cancel"){
					return;
				}
				if(planData.length == 2) {
					showMsgBox("工程下仅有一个方案，无法删除！",function(type) {
						return true;
					});
					return;
				}
				JyyLoading.start();
				$.when(delPlan(planData.id)).done(function(result){
					if (!result || result.error) {
						showMsgBox("删除方案工程失败！",function(type) {
							return true;
						});
						return;
					} else {
						planData = getPlanList(projectId);
						treeNodeIndex = planData.length-2;
						loadTreeView();
						showMsgBox("删除方案成功！",function(type) {
							return true;
						});
					}
					JyyLoading.end();
				});
			});
		}
	}

}
function onMenuClick(flag) {
	var obj=document.getElementById("contentPanel").contentWindow;
	if(obj.document.getElementById("dialogMask2")){
		obj.document.getElementById("dialogMask2").style.display='none';
	}
	window.document.getElementById("tabsDivD").style.display='none';
	$(".msgbox").hide()
	if (flag == 0) {

		loadTreeView();

		$('#tabsDiv').css('display','block');
	} else if (flag == 1) {
		getParams();
		ICONT_DSED_ENDDAY = 0;
		intcont = 0;
		tabs[0].click();
		//$('#wizardMask').show();
		$('#runPanel').show();
		$('#runPanel').draggable();
	} else if (flag == 2) {
		$('#tabsDiv').css('display','none');
		$("#contentPanel")[0].src = "../pages/resultsDisplay.html?projectId="+planId+"&modelId="+modelId;
	} else if (flag == 3) {
		$('#tabsDiv').css('display','none');
		$("#contentPanel")[0].src = "../pages/comparisonScheme.html?projectId="+projectId+"&modelId="+modelId;
	} else if (flag == 4) {
		showProPanl();
	}
}

var treeNodes = [];
function loadTreeView() {
	treeNodes = [];
	var treeProjectPanel = $('#treeProjectPanel')[0];
	var treeProjectIcon = $('#treeProjectIcon')[0];
	var treeProjectName = $('#treeProjectName')[0];
	var treePlanTree = $('#treePlanPanel')[0];

	treeProjectName.innerHTML = projectData.name;
	//$('#planNameList')[0].innerHTML = '当前方案：'+projectData.name+' > '+planData[1].name;
	var textHeight = $('#treeProjectName').height();
	//var textHeight = RxCommon.getTextSize(treeProjectName, projectData.name).height;
	console.log("projectName.height = " + textHeight);
	treeProjectPanel.style.height = (textHeight+20) + "px";
	treeProjectIcon.style.top = ((textHeight+20-16)/2) + "px";
	treePlanTree.style.top = (95 + textHeight + 20) + "px";

	treePlanTree.dispose = RxCommon.dispose;
	treePlanTree.innerHTML = "";
	var top = 0;
	for (var i = 1; i < planData.length; i++) {
		var treeNode = RxCommon.ce(treePlanTree, null, "div", "tree_plan");
		var treeText = RxCommon.ce(treeNode, null, "div", "tree_plan_text");
		treeText.innerHTML = planData[i].name;
		textHeight = $(treeText).height();
		//textHeight = RxCommon.getTextSize(treeText, planData[i].name).height;
		console.log("planName.height = " + textHeight);
		treeNode.style.height = (textHeight+20) + "px";
		treeNode.style.top = (top) + "px";
		top = top + textHeight + 20;
		treeNode.selected = false;
		treeNode.text = treeText;
		treeNode.data = planData[i];
		treeNode.onmouseover = function() {
			this.className = "tree_plan_selected";
			this.text.className = "tree_plan_text_selected";
		};
		treeNode.onmouseout = function() {
			if (this.selected == false) {
				this.className = "tree_plan";
				this.text.className = "tree_plan_text";
			}
		};
		treeNode.onclick = function(e) {
			planId = this.data.id;
			for (var j = 0; j < treeNodes.length; j++) {
				if (this == treeNodes[j]) {
					$('#planNameList')[0].innerHTML = '当前方案：'+projectData.name+' > '+treeNodes[j].data.name;
					treeNodes[j].selected = true;
					treeNodes[j].className = "tree_plan_selected";
					treeNodes[j].text.className = "tree_plan_text_selected";
					planId = treeNodes[j].data.id;
					treeNodeIndex = j;
					onPlanClick();
				} else {
					treeNodes[j].selected = false;
					treeNodes[j].className = "tree_plan";
					treeNodes[j].text.className = "tree_plan_text";
				}
			}
		}
		treeNode.oncontextmenu = function(e) {
			for (var j = 0; j < treeNodes.length; j++) {
				if (this == treeNodes[j]) {
					treeNodes[j].selected = true;
					treeNodes[j].className = "tree_plan_selected";
					treeNodes[j].text.className = "tree_plan_text_selected";
					planId = treeNodes[j].data.id;
					onContextMenu(e,planId);
				} else {
					treeNodes[j].selected = false;
					treeNodes[j].className = "tree_plan";
					treeNodes[j].text.className = "tree_plan_text";
				}
			}

		}
		treeNodes[treeNodes.length] = treeNode;
		treeNode_=treeNode;
	}
	if (treeNodes.length > 0) {
		treeNodes[treeNodeIndex].click();
	}
}

function onPlanClick () {
	console.log("projectId = " + projectId + ",planId" + planId);
	$('#tabsDiv').css('display','block');
	$("#contentPanel")[0].src = "../pages/dataSource.html?projectId="+projectId;
}
function iframeOnload () {
	JyyLoading.end();
}
function loadRunPage() {
	panel = $('#panelTab')[0];
	panel.dispose = RxCommon.dispose;
	$('.gopt_tab').each(function() {
		var i = tabs.length;
		tabs[i] = $(this)[0];
		tabs[i].selected = false;
		tabs[i].onclick = function() {
			for (var n = 0; n < tabs.length; n++) {
				if (tabs[n] == this) {
					tabs[n].selected = true;
					tabs[n].className = "gopt_tab_selected";
					$('.gopt_tab_line')[0].style.width = tabs[n].style.left;
					$('.gopt_tab_line')[1].style.left = ($(tabs[n]).position().left + $(tabs[n]).width()) + "px";
					panel.dispose();
					createTabView(n);
				} else {
					tabs[n].selected = false;
					tabs[n].className = "gopt_tab";
				}
			}
		};
	});
	tabs[0].click();
}
function createTabView(index) {
	if (index == 0) {
		createJbcs();
	} else if (index == 1) {
		createYxxx();
	} else if (index == 2) {
		createDyxx();
	} else if (index == 3) {
		createTfxx();
	} else if (index == 4) {
		createJxxx();
	} else if (index == 5) {
		if(paramList[0].DSED_HYDROLTHS == 1) {
			showMsgBox("设定不考虑水电中长期模拟，不需设定此属性页",function(type) {
				return true;
			});
			return;
		}
		createSdyxxx();
	} else if (index == 6) {
		if(paramList[0].DSED_RENEWABLESTYLE == 1) {
			showMsgBox("设定新能源出力为指定出力，不需设定此属性页",function(type) {
				return true;
			});
			return;
		}
		createXnyyxxx();
	} else if (index == 7) {
		createYhxx();
	}
}

function createJbcs() {
	console.log("createJbcs");
	/*var group = createGroup("选择方案", 10, 20, 240, 300);
	panel.appendChild(group);*/

	var data = getPlanInfo(projectId, planId);
	for (var i = 1; i < data.length; i++) {
//		listdata[listdata.length] = {code:data[i].id,name:data[i].name};
		listdata[i-1] = {code:data[i].id,name:data[i].name};
	}
	if(listdata.length != 0) {
		$("#lblInfo").text("正在设置的方案：" + listdata[0].name);
		$("#lblInfo").attr("title", listdata[0].name)
	}
	/*listview = RxTree.init(null, listdata, {listMode:"listbox"}, {top:"20px",left:"10px",width:"216px", height:"210px"}, function(param) {
		
	});
	group.addView(listview);*/

	/*var btnSelectView = RxButton.init(null, "全选", {top:"243px",left:"33px",width:"80px"}, function(param){
		for(var i = 0 ; i < listview.nodes.length ; i++){
			listview.nodes[i].check(true);
		}
	});
	group.addView(btnSelectView);
	var btnUnSelectView = RxButton.init(null, "全清", {top:"243px",left:"125px",width:"80px"}, function(param){
		for(var i = 0 ; i < listview.nodes.length ; i++){
			listview.nodes[i].check(false);
		}
	});
	group.addView(btnUnSelectView);*/

	group = createGroup("评估时间范围", 10, 20, 240, 110, 96);
	panel.appendChild(group);

	var date = new Date();
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BEGINDAY)){
		var dateconfigBegin = {
			type:6,
			years:{year:paramList[0].DSED_BEGINDAY.toString().slice(0,4),month:paramList[0].DSED_BEGINDAY.toString().slice(4,6),day:paramList[0].DSED_BEGINDAY.toString().slice(6,8)},
			formatType:{
				type0 : "YYYY-MM",
				type1 : "YYYY",
				type2 : "YYYY-J",
				type3 : "YYYY-B",
				type4 : "YYYY-W",
				type5 : "YYYY-MM-X",
				type6 : "YYYY-MM-DD"
			}
		};
	}else{
		var dateconfigBegin = {
			type:6,
			years:{year:date.getFullYear(),month:(date.getMonth()),day:date.getDate()},
			formatType:{
				type0 : "YYYY-MM",
				type1 : "YYYY",
				type2 : "YYYY-J",
				type3 : "YYYY-B",
				type4 : "YYYY-W",
				type5 : "YYYY-MM-X",
				type6 : "YYYY-MM-DD"
			}
		};
	}

	group.addView(RxLabel.init(null, "从", {top:"20px",left:"10px",width:"30px"}));
	var fromDateList = RxDate.init(null, dateconfigBegin, function(param){
		var month ='';
		var day = '';
		/*$('.rxdate_datepane').attr("οnmοuseοver","$('.rxdate_datepane')[0].style.display = 'block'");
		$('.rxdate_datepane').attr("οnmοuseοut","$('.rxdate_datepane')[0].style.display = 'none'");*/
		if(dateconfigBegin.years.month<=9){
			month = '0'+dateconfigBegin.years.month.toString();
		}else{
			month = dateconfigBegin.years.month.toString();

		}
		if(dateconfigBegin.years.day<=9){
			day = '0'+dateconfigBegin.years.day.toString();
		}else{
			day = dateconfigBegin.years.day.toString();

		}

		paramList[0].DSED_BEGINDAY = dateconfigBegin.years.year.toString()+getFormatDate(dateconfigBegin.years.month)+getFormatDate(dateconfigBegin.years.day);
		paramList[0].WPOS_BEGINDAY = dateconfigBegin.years.year.toString()+'0101';
		paramList[0].PVOS_BEGINDAY = dateconfigBegin.years.year.toString()+'0101';
	});
	var fromDateDrop = RxDropList.init(null, "", {list:fromDateList, isFixed:true}, {top:"20px",left:"60px",width:"160px"}, function(param){
		console.log(param);
	});
	group.addView(fromDateDrop);

	group.addView(RxLabel.init(null, "到", {top:"55px",left:"10px",width:"30px"}));
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_ENDDAY)){
		var subdate_ =paramList[0].DSED_ENDDAY.toString().slice(0,4)+'-'+paramList[0].DSED_ENDDAY.toString().slice(4,6)+'-'+paramList[0].DSED_ENDDAY.toString().slice(6,8);
		if (ICONT_DSED_ENDDAY==0){
			subdate_ = subDate(subdate_);
		}else{
			subdate_ = setDate(subdate_);
		}
		var dateconfigEnd = {
			type:6,
			years:{year:subdate_.slice(0,4),month:subdate_.slice(4,6),day:subdate_.slice(6,8)},
			formatType:{
				type0 : "YYYY-MM",
				type1 : "YYYY",
				type2 : "YYYY-J",
				type3 : "YYYY-B",
				type4 : "YYYY-W",
				type5 : "YYYY-MM-X",
				type6 : "YYYY-MM-DD"
			}
		};
	}else{
		var dateconfigEnd = {
			type:6,
			years:{year:date.getFullYear(),month:(date.getMonth()),day:date.getDate()},
			formatType:{
				type0 : "YYYY-MM",
				type1 : "YYYY",
				type2 : "YYYY-J",
				type3 : "YYYY-B",
				type4 : "YYYY-W",
				type5 : "YYYY-MM-X",
				type6 : "YYYY-MM-DD"
			}
		};
	}
	date_ =dateconfigEnd.years.year.toString()+'-'+getFormatDate(dateconfigEnd.years.month)+'-'+getFormatDate(dateconfigEnd.years.day);
	var toDateList = RxDate.init(null, dateconfigEnd, function(param){
		var month ='';
		var day = '';
		/*$('.rxdate_datepane').attr("οnmοuseοver","$('.rxdate_datepane')[1].style.display = 'block'");
		$('.rxdate_datepane').attr("οnmοuseοut","$('.rxdate_datepane')[1].style.display = 'none'");*/
		if(dateconfigEnd.years.month.toString().length==1){
			month = '0'+dateconfigEnd.years.month.toString();
		}else{
			month = dateconfigEnd.years.month.toString();
		}
//		month = dateconfigEnd.years.month.toString();	
		if(dateconfigEnd.years.day<=9){
			day = '0'+dateconfigEnd.years.day.toString();
		}else{
			day = dateconfigEnd.years.day.toString();
		}
		date_ =dateconfigEnd.years.year.toString()+'-'+getFormatDate(dateconfigEnd.years.month)+'-'+getFormatDate(dateconfigEnd.years.day);
		paramList[0].DSED_ENDDAY = dateconfigEnd.years.year.toString()+month+day;
		//paramList[0].DSED_ENDDAY = addDate(date_);
		ICONT_DSED_ENDDAY++;
		//paramList[0].DSED_ENDDAY = dateconfigEnd.years.year.toString()+month+day;
		paramList[0].WPOS_ENDDAY = (parseInt(dateconfigEnd.years.year)+1).toString()+'0101';
		paramList[0].PVOS_ENDDAY = (parseInt(dateconfigEnd.years.year)+1).toString()+'0101';
	});
	var toDateDrop = RxDropList.init(null, "", {list:toDateList, isFixed:true}, {top:"55px",left:"60px",width:"160px"}, function(param){
		console.log(param);
	});
	group.addView(toDateDrop);

	group = createGroup("典型场景选择", 130, 20, 240, 180, 96);
	panel.appendChild(group);
	var rdoSence1Checked = true;
	var rdoSence2Checked = false;
	var rdoSence3Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RESOLUTION)){
		if(paramList[0].DSED_RESOLUTION == 1){
			rdoSence1Checked = false;
			rdoSence2Checked = true;
			rdoSence3Checked = false;
		}else if (paramList[0].DSED_RESOLUTION == 2){
			rdoSence1Checked = false;
			rdoSence2Checked = false;
			rdoSence3Checked = true;
		}
	}
	var rdoSence1 = JyyRadio.init(null, "sence", rdoSence1Checked,  "0", "逐日模拟", {top:"20px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_RESOLUTION = 0;
		chkSence1.disable(true);
		chkSence2.disable(true);
		chkSence3.disable(true);
		chkSence4.disable(true);
	});
	var rdoSence2 = JyyRadio.init(null, "sence", rdoSence2Checked, "1", "月典型日", {top:"50px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_RESOLUTION = 1;
		chkSence1.disable(false);
		chkSence2.disable(false);
		chkSence3.disable(false);
		chkSence4.disable(false);
	});
	var rdoSence3 = JyyRadio.init(null, "sence", rdoSence3Checked, "2", "年典型日", {top:"80px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_RESOLUTION = 2;
		chkSence1.disable(false);
		chkSence2.disable(false);
		chkSence3.disable(false);
		chkSence4.disable(false);
	});
	group.addView(rdoSence1);
	group.addView(rdoSence2);
	group.addView(rdoSence3);

	var chkSence1Checked = false;
	var chkSence2Checked = false;
	var chkSence3Checked = false;
	var chkSence4Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_SCENARIO_MAXLOAD)){
		if(paramList[0].DSED_SCENARIO_MAXLOAD == 1){
			chkSence1Checked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_SCENARIO_MINLOAD)){
		if(paramList[0].DSED_SCENARIO_MINLOAD == 1){
			chkSence2Checked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_SCENARIO_MAXPEAK)){
		if(paramList[0].DSED_SCENARIO_MAXPEAK == 1){
			chkSence3Checked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_SCENARIO_MINPEAK)){
		if(paramList[0].DSED_SCENARIO_MINPEAK == 1){
			chkSence4Checked = true;
		}
	}
	var chkSence1 = JyyCheckBox.init(null, chkSence1Checked, "1", "最大负荷日", {top:"20px",left:"130px",width:"100px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_SCENARIO_MAXLOAD = 1;
		}else if(param.checked == false){
			paramList[0].DSED_SCENARIO_MAXLOAD = 0;
		}
	});
	var chkSence2 = JyyCheckBox.init(null, chkSence2Checked, "1", "最小负荷日", {top:"50px",left:"130px",width:"100px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_SCENARIO_MINLOAD = 1;
		}else if(param.checked == false){
			paramList[0].DSED_SCENARIO_MINLOAD = 0;
		}
	});
	var chkSence3 = JyyCheckBox.init(null, chkSence3Checked, "1", "最大峰谷差日", {top:"80px",left:"130px",width:"100px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_SCENARIO_MAXPEAK = 1;
		}else if(param.checked == false){
			paramList[0].DSED_SCENARIO_MAXPEAK = 0;
		}
	});
	var chkSence4 = JyyCheckBox.init(null, chkSence4Checked, "1", "最小峰谷差日", {top:"110px",left:"130px",width:"100px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_SCENARIO_MINPEAK = 1;
		}else if(param.checked == false){
			paramList[0].DSED_SCENARIO_MINPEAK = 0;
		}
	});
	chkSence1.disable(true);
	chkSence2.disable(true);
	chkSence3.disable(true);
	chkSence4.disable(true);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RESOLUTION)){
		if(paramList[0].DSED_RESOLUTION == 1){
			chkSence1.disable(false);
			chkSence2.disable(false);
			chkSence3.disable(false);
			chkSence4.disable(false);
		}else if (paramList[0].DSED_RESOLUTION == 2){
			chkSence1.disable(false);
			chkSence2.disable(false);
			chkSence3.disable(false);
			chkSence4.disable(false);
		}
	}
	group.addView(chkSence1);
	group.addView(chkSence2);
	group.addView(chkSence3);
	group.addView(chkSence4);

}

function createYxxx() {
	var group = createGroup("优化目标", 10, 20, 580, 100);
	panel.appendChild(group);

	var rdoYhmb1Checked = true;
	var rdoYhmb2Checked = false;
	var rdoYhmb3Checked = false;
	var rdoYhmb4Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_OPTIMIZEOPTION)){
		if(paramList[0].DSED_OPTIMIZEOPTION == 1){
			rdoYhmb1Checked = false;
			rdoYhmb2Checked = true;
			rdoYhmb3Checked = false;
			rdoYhmb4Checked = false;
		}else if (paramList[0].DSED_OPTIMIZEOPTION == 2){
			rdoYhmb1Checked = false;
			rdoYhmb2Checked = false;
			rdoYhmb3Checked = true;
			rdoYhmb4Checked = false;
		}else if (paramList[0].DSED_OPTIMIZEOPTION == 3){
			rdoYhmb1Checked = false;
			rdoYhmb2Checked = false;
			rdoYhmb3Checked = false;
			rdoYhmb4Checked = true;
		}
	}
	var rdoYhmb1 = JyyRadio.init(null, "t1g1", rdoYhmb1Checked,  "0", "运行成本最低", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].DSED_OPTIMIZEOPTION = 0;
		chkYhmb1.disable(false);
		txtYhmb.setReadOnly(false);
		label1.style.color = '#666666';
		label2.style.color = '#666666';
	});
	var rdoYhmb2 = JyyRadio.init(null, "t1g1", rdoYhmb2Checked, "1", "购电费用最低", {top:"15px",left:"160px",width:"140px"}, function(param){
		paramList[0].DSED_OPTIMIZEOPTION = 1;
		chkYhmb1.disable(false);
		txtYhmb.setReadOnly(false);
		label1.style.color = '#666666';
		label2.style.color = '#666666';
	});
	var rdoYhmb3 = JyyRadio.init(null, "t1g1", rdoYhmb3Checked, "2", "三公调整", {top:"15px",left:"300px",width:"140px"}, function(param){
		paramList[0].DSED_OPTIMIZEOPTION = 2;
		chkYhmb1.disable(false);
		txtYhmb.setReadOnly(false);
		label1.style.color = '#666666';
		label2.style.color = '#666666';
	});
	var rdoYhmb4 = JyyRadio.init(null, "t1g1", rdoYhmb4Checked, "3", "节能发电调度", {top:"15px",left:"440px",width:"140px"}, function(param){
		paramList[0].DSED_OPTIMIZEOPTION = 3;
		chkYhmb1.disable(true);
		txtYhmb.setReadOnly(true);
		label1.style.color = '#c6c6c6';
		label2.style.color = '#c6c6c6';
	});
	group.addView(rdoYhmb1);
	group.addView(rdoYhmb2);
	group.addView(rdoYhmb3);
	group.addView(rdoYhmb4);

	var chkYhmb1Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_EMISSION_CORRECTION)){
		if(paramList[0].DSED_EMISSION_CORRECTION != 0){
			chkYhmb1Checked = true;
		}
	}
	var chkYhmb1 = JyyCheckBox.init(null, chkYhmb1Checked, "1", "考虑排放惩罚", {top:"45px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_EMISSION_CORRECTION = 1;
		}else if(param.checked == false){
			paramList[0].DSED_EMISSION_CORRECTION = 0;
		}
	});
	chkYhmb1.disable(false);
	if(paramList.length>0 && paramList[0].DSED_OPTIMIZEOPTION == 3){
		chkYhmb1.disable(true);
	}
	var label1 = RxLabel.init(null, "惩罚系数", {top:"45px",left:"160px",width:"80px",textAlign:"left"});
	group.addView(label1);

	var txtYhmbChecked = 20;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_EMISSION_RATIO)){
		var txtYhmbChecked = paramList[0].DSED_EMISSION_RATIO;
	}
	var txtYhmb = RxText.init(null, txtYhmbChecked, "", {top:"45px",left:"230px",width:"53px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_EMISSION_RATIO = param.value;
		}
	});
	var label2 = RxLabel.init(null, "元/吨CO2", {top:"45px",left:"290px",width:"80px",textAlign:"left"})
	if(paramList.length>0 && paramList[0].DSED_OPTIMIZEOPTION == 3){
		txtYhmb.setReadOnly(true);
		label1.style.color = '#c6c6c6';
		label2.style.color = '#c6c6c6';
	}
	group.addView(label2);
	group.addView(txtYhmb);
	var chkYhmb2Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_TRANSLOSS_CORRECTION)){
		if(paramList[0].DSED_TRANSLOSS_CORRECTION == 1){
			chkYhmb2Checked = true;
		}
	}
	var chkYhmb2 = JyyCheckBox.init(null, chkYhmb2Checked, "1", "考虑网损修正", {top:"45px",left:"440px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_TRANSLOSS_CORRECTION = 1;
		}else if(param.checked == false){
			paramList[0].DSED_TRANSLOSS_CORRECTION = 0;
		}
	});
	group.addView(chkYhmb1);
	group.addView(chkYhmb2);

	group = createGroup("可选约束", 120, 20, 580, 65);
	panel.appendChild(group);
	var chkKxys1Checked = false;
	var chkKxys2Checked = false;
	var chkKxys3Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GRIDCONS)){
		if(paramList[0].DSED_GRIDCONS == 1){
			chkKxys1Checked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_FLOWGATECONS)){
		if(paramList[0].DSED_FLOWGATECONS == 1){
			chkKxys2Checked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GRIDCONSITERA)){
		if(paramList[0].DSED_GRIDCONSITERA == 1){
			chkKxys3Checked = true;
		}
	}
	var chkKxys1 = JyyCheckBox.init(null, chkKxys1Checked, "1", "考虑线路约束", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_GRIDCONS = 1;
		}else if(param.checked == false){
			paramList[0].DSED_GRIDCONS = 0;
		}
	});
	var chkKxys2 = JyyCheckBox.init(null, chkKxys2Checked, "1", "考虑断面约束", {top:"15px",left:"160px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_FLOWGATECONS = 1;
		}else if(param.checked == false){
			paramList[0].DSED_FLOWGATECONS = 0;
		}
	});
	var chkKxys3 = JyyCheckBox.init(null, chkKxys3Checked, "1", "是否采用迭代加速策略", {top:"15px",left:"300px",width:"190px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_GRIDCONSITERA = 1;
		}else if(param.checked == false){
			paramList[0].DSED_GRIDCONSITERA = 0;
		}
	});
	group.addView(chkKxys1);
	group.addView(chkKxys2);
	group.addView(chkKxys3);

	group = createGroup("备用选项", 195, 20, 580, 190);
	panel.appendChild(group);

	var chkXtzby1Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
		if(paramList[0].DSED_RUTYPE == 0){
			chkXtzby1Checked = false;
		}
	}
	var chkXtzby1 = JyyCheckBox.init(null, chkXtzby1Checked, "1", "系统正备用", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_RUTYPE = 1;
			txtXtzby1.setReadOnly(false);
			txtXtzby1.input.style.color="#666666";
			rdoXtzby1.disable(false);
			rdoXtzby2.disable(false);
			rdoXtzby3.disable(false);
		}else if(param.checked == false){
			paramList[0].DSED_RUTYPE = 0;
			txtXtzby1.input.style.color="#c6c6c6";
			txtXtzby1.setReadOnly(true);
			rdoXtzby1.disable(true);
			rdoXtzby2.disable(true);
			rdoXtzby3.disable(true);
		}
	});
	group.addView(chkXtzby1);

	var txtXtzby1Checked = 0.05;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RU)){
		txtXtzby1Checked = paramList[0].DSED_RU;
	}
	var txtXtzby1 = RxText.init(null, txtXtzby1Checked, "", {top:"15px",left:"160px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_RU = param.value;
		}
	});

	var rdoXtzby1Checked = true;
	var rdoXtzby2Checked = false;
	var rdoXtzby3Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
		if(paramList[0].DSED_RUTYPE == 2){
			rdoXtzby1Checked = false;
			rdoXtzby2Checked = true;
			rdoXtzby3Checked = false;
		}else if(paramList[0].DSED_RUTYPE == 3){
			rdoXtzby1Checked = false;
			rdoXtzby2Checked = false;
			rdoXtzby3Checked = true;
		}
	}
	var rdoXtzby1 = JyyRadio.init(null, "t1g2", rdoXtzby1Checked,  "1", "全系统留取", {top:"45px",left:"20px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
			if(paramList[0].DSED_RUTYPE != 0){
				paramList[0].DSED_RUTYPE = 1;
			}else{
				paramList[0].DSED_RUTYPE = 0;
			}
		}
	});
	var rdoXtzby2 = JyyRadio.init(null, "t1g2", rdoXtzby2Checked, "2", "按区域留取", {top:"45px",left:"160px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
			if(paramList[0].DSED_RUTYPE != 0){
				paramList[0].DSED_RUTYPE = 2;
			}else{
				paramList[0].DSED_RUTYPE = 0;
			}
		}
	});
	var rdoXtzby3 = JyyRadio.init(null, "t1g2", rdoXtzby3Checked, "3", "按机组留取", {top:"45px",left:"300px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
			if(paramList[0].DSED_RUTYPE != 0){
				paramList[0].DSED_RUTYPE = 3;
			}else{
				paramList[0].DSED_RUTYPE = 0;
			}
		}
	});
	txtXtzby1.setReadOnly(false);
	rdoXtzby1.disable(false);
	rdoXtzby2.disable(false);
	rdoXtzby3.disable(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
		if(paramList[0].DSED_RUTYPE == 0){
			txtXtzby1.setReadOnly(true);
			txtXtzby1.input.style.color="#c6c6c6";
			rdoXtzby1.disable(true);
			rdoXtzby2.disable(true);
			rdoXtzby3.disable(true);
		}
	}
	group.addView(txtXtzby1);
	group.addView(rdoXtzby1);
	group.addView(rdoXtzby2);
	group.addView(rdoXtzby3);

	var chkXtfby1Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RDTYPE)){
		if(paramList[0].DSED_RDTYPE == 0){
			chkXtfby1Checked = false;
		}
	}
	var chkXtfby1 = JyyCheckBox.init(null, chkXtfby1Checked, "1", "系统负备用", {top:"75px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_RDTYPE = 1;
			txtXtfby1.setReadOnly(false);
			txtXtfby1.input.style.color="#666666";
			rdoXtfby1.disable(false);
			rdoXtfby2.disable(false);
			rdoXtfby3.disable(false);
		}else if(param.checked == false){
			paramList[0].DSED_RDTYPE = 0;
			txtXtfby1.setReadOnly(true);
			txtXtfby1.input.style.color="#c6c6c6";
			rdoXtfby1.disable(true);
			rdoXtfby2.disable(true);
			rdoXtfby3.disable(true);
		}
	});

	group.addView(chkXtfby1);

	var txtXtfby1Checked = 0.02;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RD)){
		txtXtfby1Checked = paramList[0].DSED_RD;
	}
	var txtXtfby1 = RxText.init(null, txtXtfby1Checked, "", {top:"75px",left:"160px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_RD = param.value;
		}
	});

	var rdoXtfby1Checked = true;
	var rdoXtfby2Checked = false;
	var rdoXtfby3Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
		if(paramList[0].DSED_RDTYPE == 2){
			rdoXtfby1Checked = false;
			rdoXtfby2Checked = true;
			rdoXtfby3Checked = false;
		}else if(paramList[0].DSED_RDTYPE == 3){
			rdoXtfby1Checked = false;
			rdoXtfby2Checked = false;
			rdoXtfby3Checked = true;
		}
	}
	var rdoXtfby1 = JyyRadio.init(null, "t1g3", rdoXtfby1Checked,  "1", "全系统留取", {top:"105px",left:"20px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RDTYPE)){
			if(paramList[0].DSED_RDTYPE != 0){
				paramList[0].DSED_RDTYPE = 1;
			}else{
				paramList[0].DSED_RDTYPE = 0;
			}
		}
	});
	var rdoXtfby2 = JyyRadio.init(null, "t1g3", rdoXtfby2Checked, "2", "按区域留取", {top:"105px",left:"160px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RDTYPE)){
			if(paramList[0].DSED_RDTYPE != 0){
				paramList[0].DSED_RDTYPE = 2;
			}else{
				paramList[0].DSED_RDTYPE = 0;
			}
		}
	});
	var rdoXtfby3 = JyyRadio.init(null, "t1g3", rdoXtfby3Checked, "3", "按机组留取", {top:"105px",left:"300px",width:"140px"}, function(param){
		if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RDTYPE)){
			if(paramList[0].DSED_RDTYPE != 0){
				paramList[0].DSED_RDTYPE = 3;
			}else{
				paramList[0].DSED_RDTYPE = 0;
			}
		}
	});
	txtXtfby1.setReadOnly(false);
	rdoXtfby1.disable(false);
	rdoXtfby2.disable(false);
	rdoXtfby3.disable(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUTYPE)){
		if(paramList[0].DSED_RUTYPE == 0){
			txtXtfby1.setReadOnly(true);
			txtXtfby1.input.style.color="#c6c6c6";
			rdoXtfby1.disable(true);
			rdoXtfby2.disable(true);
			rdoXtfby3.disable(true);
		}
	}
	group.addView(txtXtfby1);
	group.addView(rdoXtfby1);
	group.addView(rdoXtfby2);
	group.addView(rdoXtfby3);

	group.addView(RxLabel.init(null, "系统停机备用", {top:"135px",left:"20px",width:"140px",textAlign:"left"}));

	var txtXttjby1Checked = 0.05;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RSTATIC)){
		txtXttjby1Checked = paramList[0].DSED_RSTATIC;
	}
	var txtXttjby1 = RxText.init(null, txtXttjby1Checked, "", {top:"135px",left:"160px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_RSTATIC = param.value;
		}
	});
	group.addView(txtXttjby1);
	//未找到对应字段
	var chkXttjby1 = JyyCheckBox.init(null, false, "1", "为新能源预留备用", {top:"135px",left:"300px",width:"160px"}, function(param){
		console.log(param);
	});
	group.addView(chkXttjby1);

	group = createGroup("可选约束", 395, 20, 580, 65);
	panel.appendChild(group);

	var chkScxx1Checeked = true;
	var chkScxx2Checeked = true;
	var chkScxx3Checeked = false;
	var chkScxx4Checeked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BLINEFLOW)){
		if(paramList[0].DSED_BLINEFLOW == 0){
			chkScxx1Checeked = false;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BSECTIONFLOW)){
		if(paramList[0].DSED_BSECTIONFLOW == 0){
			chkScxx2Checeked = false;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BNODELOAD)){
		if(paramList[0].DSED_BNODELOAD == 1){
			chkScxx3Checeked = true;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BMARGINALPRICE)){
		if(paramList[0].DSED_BMARGINALPRICE == 1){
			chkScxx4Checeked = true;
		}
	}
	var chkScxx1 = JyyCheckBox.init(null, chkScxx1Checeked, "1", "输出断面潮流", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_BLINEFLOW = 1;
		}else if(param.checked == false){
			paramList[0].DSED_BLINEFLOW = 0;
		}
	});
	var chkScxx2 = JyyCheckBox.init(null, chkScxx2Checeked, "1", "输出线路潮流", {top:"15px",left:"160px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_BSECTIONFLOW = 1;
		}else if(param.checked == false){
			paramList[0].DSED_BSECTIONFLOW = 0;
		}
	});
	var chkScxx3 = JyyCheckBox.init(null, chkScxx3Checeked, "1", "输出节点负荷", {top:"15px",left:"300px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_BNODELOAD = 1;
		}else if(param.checked == false){
			paramList[0].DSED_BNODELOAD = 0;
		}
	});
	var chkScxx4 = JyyCheckBox.init(null, chkScxx4Checeked, "1", "输出边际成本", {top:"15px",left:"440px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_BMARGINALPRICE = 1;
		}else if(param.checked == false){
			paramList[0].DSED_BMARGINALPRICE = 0;
		}
	});
	group.addView(chkScxx1);
	group.addView(chkScxx2);
	group.addView(chkScxx3);
	group.addView(chkScxx4);
}

function createDyxx() {
	var group = createGroup("水电运行方式", 10, 20, 310, 125);
	panel.appendChild(group);

	var chkSdyx1Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_HYDROLTHS)){
		if(paramList[0].DSED_HYDROLTHS == 1){
			chkSdyx1Checked = false;
		}
	}
	var chkSdyx1 = JyyCheckBox.init(null, chkSdyx1Checked, "0", "考虑中长期水电模拟", {top:"15px",left:"20px",width:"170px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_HYDROLTHS = 0;
		}else if(param.checked == false){
			paramList[0].DSED_HYDROLTHS = 1;
		}
	});
	group.addView(chkSdyx1);

	var rdoSdyx11Checked = true;
	var rdoSdyx12Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_HYDROSTYLE)){
		if(paramList[0].DSED_HYDROSTYLE == 1){
			rdoSdyx11Checked = false;
			rdoSdyx12Checked = true;
		}
	}
	var rdoSdyx11 = JyyRadio.init(null, "t2g1", rdoSdyx11Checked,  "0", "电量约束", {top:"45px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROSTYLE = 0;
		rdoSdyx21.disable(false);
		rdoSdyx22.disable(false);
		rdoSdyx23.disable(false);
	});
	var rdoSdyx12 = JyyRadio.init(null, "t2g1", rdoSdyx12Checked, "1", "水量约束", {top:"45px",left:"120px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROSTYLE = 1;
		rdoSdyx21.disable(true);
		rdoSdyx22.disable(true);
		rdoSdyx23.disable(true);
	});
	group.addView(rdoSdyx11);
	group.addView(rdoSdyx12);

	var rdoSdyx21Checked = false;
	var rdoSdyx22Checked = true;
	var rdoSdyx23Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_HYDROYEAR)){
		if(paramList[0].DSED_HYDROYEAR == 1){
			rdoSdyx21Checked = true;
			rdoSdyx22Checked = false;
			rdoSdyx23Checked = false;
		}else if(paramList[0].DSED_HYDROYEAR == 3){
			rdoSdyx21Checked = false;
			rdoSdyx22Checked = false;
			rdoSdyx23Checked = true;
		}
	}
	var rdoSdyx21 = JyyRadio.init(null, "t2g2", rdoSdyx21Checked,  "1", "枯水年", {top:"75px",left:"20px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROYEAR = 1;
	});
	var rdoSdyx22 = JyyRadio.init(null, "t2g2", rdoSdyx22Checked, "2", "平水年", {top:"75px",left:"120px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROYEAR = 2;
	});
	var rdoSdyx23 = JyyRadio.init(null, "t2g2", rdoSdyx23Checked, "3", "丰水年", {top:"75px",left:"220px",width:"100px"}, function(param){
		paramList[0].DSED_HYDROYEAR = 3;
	});
	rdoSdyx21.disable(false);
	rdoSdyx22.disable(false);
	rdoSdyx23.disable(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_HYDROSTYLE)){
		if(paramList[0].DSED_HYDROSTYLE == 1){
			rdoSdyx21.disable(true);
			rdoSdyx22.disable(true);
			rdoSdyx23.disable(true);
		}
	}
	group.addView(rdoSdyx21);
	group.addView(rdoSdyx22);
	group.addView(rdoSdyx23);

	group = createGroup("核电选项", 145, 20, 310, 95);
	panel.appendChild(group);

	var rdoHdxx31Checked = true;
	var rdoHdxx32Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_NUCLEARSTYLE)){
		if(paramList[0].DSED_NUCLEARSTYLE == 1){
			rdoHdxx31Checked = false;
			rdoHdxx32Checked = true;
		}
	}
	var rdoHdxx31 = JyyRadio.init(null, "t2g3", rdoHdxx31Checked,  "0", "按额定容量运行", {top:"15px",left:"20px",width:"200px"}, function(param){
		paramList[0].DSED_NUCLEARSTYLE = 0;
	});
	var rdoHdxx32 = JyyRadio.init(null, "t2g3", rdoHdxx32Checked, "1", "调峰容量不足时考虑降出力运行", {top:"45px",left:"20px",width:"250px"}, function(param){
		paramList[0].DSED_NUCLEARSTYLE = 1;
	});
	group.addView(rdoHdxx31);
	group.addView(rdoHdxx32);

	group = createGroup("弃风/光与弃水选项", 250, 20, 310, 125, 135);
	panel.appendChild(group);

	var chkQfgs41Checked = true;
	var chkQfgs42Checked = false;
	var rdoQfgs41Checked = true;
	var rdoQfgs42Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_CURTAILWINDPVORDER) && !JyyCommon.isEmpty(paramList[0].DSED_CURTAILHYDROORDER)){
		if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			chkQfgs41Checked = true;
			chkQfgs42Checked = true;
			rdoQfgs41Checked = true;
			rdoQfgs42Checked = false;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 2 && paramList[0].DSED_CURTAILHYDROORDER == 1){
			chkQfgs41Checked = true;
			chkQfgs42Checked = true;
			rdoQfgs41Checked = false;
			rdoQfgs42Checked = true;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			chkQfgs41Checked = true;
			chkQfgs42Checked = false;
			rdoQfgs41Checked = true;
			rdoQfgs42Checked = false;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			chkQfgs41Checked = false;
			chkQfgs42Checked = true;
			rdoQfgs41Checked = false;
			rdoQfgs42Checked = true;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			chkQfgs41Checked = false;
			chkQfgs42Checked = false;
			rdoQfgs41Checked = true;
			rdoQfgs42Checked = false;
		}
	}
	var chkQfgs41 = JyyCheckBox.init(null, chkQfgs41Checked, "1", "允许弃风/光", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			if(paramList[0].DSED_CURTAILHYDROORDER != -1) {
				rdoQfgs41.disable(false);
				rdoQfgs42.disable(false);
			}
		}else if(param.checked == false){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			rdoQfgs41.disable(true);
			rdoQfgs42.disable(true);
		}
	});
	var chkQfgs42 = JyyCheckBox.init(null, chkQfgs42Checked, "2", "允许弃水", {top:"15px",left:"160px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_CURTAILHYDROORDER = 2;
			if(paramList[0].DSED_CURTAILWINDPVORDER != -1) {
				rdoQfgs41.disable(false);
				rdoQfgs42.disable(false);
			}
		}else if(param.checked == false){
			paramList[0].DSED_CURTAILHYDROORDER = -1;
			rdoQfgs41.disable(true);
			rdoQfgs42.disable(true);
		}
	});
	group.addView(chkQfgs41);
	group.addView(chkQfgs42);
	var rdoQfgs41 = JyyRadio.init(null, "t2g4", rdoQfgs41Checked,  "0", "先弃风/光再弃水", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 2 && paramList[0].DSED_CURTAILHYDROORDER == 1){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}
	});
	var rdoQfgs42 = JyyRadio.init(null, "t2g4", rdoQfgs42Checked, "0", "先弃水再弃风/光", {top:"75px",left:"20px",width:"200px"}, function(param){
		if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = 2;
			paramList[0].DSED_CURTAILHYDROORDER = 1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 2 && paramList[0].DSED_CURTAILHYDROORDER == 1){
			paramList[0].DSED_CURTAILWINDPVORDER = 2;
			paramList[0].DSED_CURTAILHYDROORDER = 1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == 1 && paramList[0].DSED_CURTAILHYDROORDER == -1){
			paramList[0].DSED_CURTAILWINDPVORDER = 1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = 2;
		}else if(paramList[0].DSED_CURTAILWINDPVORDER == -1 && paramList[0].DSED_CURTAILHYDROORDER == 2){
			paramList[0].DSED_CURTAILWINDPVORDER = -1;
			paramList[0].DSED_CURTAILHYDROORDER = -1;
		}
	});
	rdoQfgs41.disable(false);
	rdoQfgs42.disable(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_CURTAILWINDPVORDER) && !JyyCommon.isEmpty(paramList[0].DSED_CURTAILHYDROORDER)){
		if(paramList[0].DSED_CURTAILWINDPVORDER == -1 || paramList[0].DSED_CURTAILHYDROORDER == -1){
			rdoQfgs41.disable(true);
			rdoQfgs42.disable(true);
		}
	}
	group.addView(rdoQfgs41);
	group.addView(rdoQfgs42);

	group = createGroup("抽蓄运行方式", 10, 350, 280, 125, 96);
	panel.appendChild(group);

	var rdoCxyx11Checked = false;
	var rdoCxyx12Checked = false;
	var rdoCxyx13Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_PUMPSTYLE)){
		if(paramList[0].DSED_PUMPSTYLE == 0){
			rdoCxyx11Checked = true;
			rdoCxyx12Checked = false;
			rdoCxyx13Checked = false;
		}else if(paramList[0].DSED_PUMPSTYLE == 1){
			rdoCxyx11Checked = false;
			rdoCxyx12Checked = true;
			rdoCxyx13Checked = false;
		}else if(paramList[0].DSED_PUMPSTYLE == 2){
			rdoCxyx11Checked = false;
			rdoCxyx12Checked = false;
			rdoCxyx13Checked = true;
		}
	}
	var rdoCxyx11 = JyyRadio.init(null, "t2g5", rdoCxyx11Checked,  "0", "优先做备用", {top:"15px",left:"20px",width:"120px"}, function(param){
		paramList[0].DSED_PUMPSTYLE = 0;
	});
	var rdoCxyx12 = JyyRadio.init(null, "t2g5", rdoCxyx12Checked, "1", "优先抽水发电", {top:"15px",left:"140px",width:"125px"}, function(param){
		paramList[0].DSED_PUMPSTYLE = 1;
	});
	var rdoCxyx13 = JyyRadio.init(null, "t2g5", rdoCxyx13Checked,  "2", "优先安排出力", {top:"45px",left:"20px",width:"125px"}, function(param){
		paramList[0].DSED_PUMPSTYLE =2;
	});
	group.addView(rdoCxyx11);
	group.addView(rdoCxyx12);
	group.addView(rdoCxyx13);

	group.addView(RxLabel.init(null, "周优化容量比例", {top:"75px",left:"40px",width:"120px",textAlign:"left"}));

	var txtCxyx1Checked = 50;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_PUMPWEEKOPTRATIO)){
		txtCxyx1Checked = paramList[0].DSED_PUMPWEEKOPTRATIO*100;
	}
	var txtCxyx1 = RxText.init(null, txtCxyx1Checked, "", {top:"75px",left:"160px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_PUMPWEEKOPTRATIO = param.value/100;
		}
	});
	group.addView(txtCxyx1);
	group.addView(RxLabel.init(null, "%", {top:"75px",left:"215px",width:"20px",textAlign:"left"}));

	group = createGroup("可再生能源运行方式", 145, 350, 280, 195,144);
	panel.appendChild(group);

	var rdoKzsny1Checked = true;
	var rdoKzsny2Checked = false;
	var rdoKzsny3Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RENEWABLESTYLE)){
		if(paramList[0].DSED_RENEWABLESTYLE == 0){
			rdoKzsny1Checked = true;
			rdoKzsny2Checked = false;
			rdoKzsny3Checked = false;
		}else if(paramList[0].DSED_RENEWABLESTYLE == 1){
			rdoKzsny1Checked = false;
			rdoKzsny2Checked = true;
			rdoKzsny3Checked = false;
		}else if(paramList[0].DSED_RENEWABLESTYLE == 2){
			rdoKzsny1Checked = false;
			rdoKzsny2Checked = false;
			rdoKzsny3Checked = true;
		}
	}
	var rdoKzsny1 = JyyRadio.init(null, "t2g6", rdoKzsny1Checked,  "0", "随机模拟出力", {top:"15px",left:"20px",width:"200px"}, function(param){
		paramList[0].DSED_RENEWABLESTYLE = 0;
		txtKzsny1.setReadOnly(true);
		txtKzsny1.input.style.color="#c6c6c6";
		txtKzsny2.setReadOnly(true);
		txtKzsny2.input.style.color="#c6c6c6";
	});
	var rdoKzsny2 = JyyRadio.init(null, "t2g6", rdoKzsny2Checked, "1", "", {top:"50px",left:"20px",width:"200px",height:"30px"}, function(param){
		paramList[0].DSED_RENEWABLESTYLE = 1;
		txtKzsny1.setReadOnly(true);
		txtKzsny1.input.style.color="#c6c6c6";
		txtKzsny2.setReadOnly(true);
		txtKzsny2.input.style.color="#c6c6c6";
	});
	group.addView(RxLabel.init(null, "外部指定出力（未指定时段", {top:"39px",left:"40px",width:"240px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "分仍进行随机模拟）", {top:"59px",left:"40px",width:"240px",textAlign:"left"}));
	var rdoKzsny3 = JyyRadio.init(null, "t2g6", rdoKzsny3Checked, "2", "固定出力", {top:"85px",left:"20px",width:"200px"}, function(param){
		paramList[0].DSED_RENEWABLESTYLE = 2;
		txtKzsny1.setReadOnly(false);
		txtKzsny1.input.style.color="#666666";
		txtKzsny2.setReadOnly(false);
		txtKzsny2.input.style.color="#666666";
	});
	group.addView(rdoKzsny1);
	group.addView(rdoKzsny2);
	group.addView(rdoKzsny3);
	group.addView(RxLabel.init(null, "峰时段出力", {top:"110px",left:"40px",width:"100px",textAlign:"left"}));

	var txtKzsny1Checked = 0;

	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RENEWABLEPEAKOUTPUT)){
		txtKzsny1Checked = paramList[0].DSED_RENEWABLEPEAKOUTPUT*100;
	}
	var txtKzsny1 = RxText.init(null, txtKzsny1Checked, "", {top:"110px",left:"140px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_RENEWABLEPEAKOUTPUT = param.value/100;
		}
	});

	var txtKzsny2Checked = 50;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_DRENEWABLEVALLEYOUTPUT)){
		txtKzsny2Checked = paramList[0].DSED_DRENEWABLEVALLEYOUTPUT*100;
	}
	var txtKzsny2 = RxText.init(null, txtKzsny2Checked, "", {top:"140px",left:"140px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_DRENEWABLEVALLEYOUTPUT = param.value/100;
		}
	});
	txtKzsny1.setReadOnly(true);
	txtKzsny1.input.style.color="#c6c6c6";
	txtKzsny2.setReadOnly(true);
	txtKzsny2.input.style.color="#c6c6c6";
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RENEWABLESTYLE)){
		if(paramList[0].DSED_RENEWABLESTYLE == 2){
			txtKzsny1.setReadOnly(false);
			txtKzsny1.input.style.color="#666666";
			txtKzsny2.setReadOnly(false);
			txtKzsny2.input.style.color="#666666";
		}
	}
	group.addView(txtKzsny1);
	group.addView(RxLabel.init(null, "%", {top:"110px",left:"195px",width:"20px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "谷时段出力", {top:"140px",left:"40px",width:"100px",textAlign:"left"}));
	group.addView(txtKzsny2);
	group.addView(RxLabel.init(null, "%", {top:"140px",left:"195px",width:"20px",textAlign:"left"}));

	group = createGroup("储能运行方式", 350, 350, 280, 100, 96);
	panel.appendChild(group);

	var chkCnyx1Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BBATTERYWEEK)){
		if(paramList[0].DSED_BBATTERYWEEK == 1){
			chkCnyx1Checked = true;
		}
	}
	var chkCnyx1 = JyyCheckBox.init(null, chkCnyx1Checked, "1", "考虑储能周优化", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_BBATTERYWEEK = 1;
			txtCnyx1.setReadOnly(false);
			txtCnyx1.input.style.color="#666666";
		}else if(param.checked == false){
			paramList[0].DSED_BBATTERYWEEK = 0;
			txtCnyx1.setReadOnly(true);
			txtCnyx1.input.style.color="#c6c6c6";
		}
	});
	group.addView(chkCnyx1);
	group.addView(RxLabel.init(null, "周优化容量比例", {top:"45px",left:"40px",width:"120px",textAlign:"left"}));

	var txtCnyx1Checked = 0;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BATTERYWEEKOPTRATIO)){
		txtCnyx1Checked = paramList[0].DSED_BATTERYWEEKOPTRATIO*100;
	}
	var txtCnyx1 = RxText.init(null, txtCnyx1Checked, "", {top:"45px",left:"160px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_BATTERYWEEKOPTRATIO = param.value/100;
		}
	});
	txtCnyx1.setReadOnly(true);
	txtCnyx1.input.style.color="#c6c6c6";
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_BBATTERYWEEK)){
		if(paramList[0].DSED_BBATTERYWEEK == 1){
			txtCnyx1.setReadOnly(false);
			txtCnyx1.input.style.color="#666666";
		}
	}
	group.addView(txtCnyx1);
	group.addView(RxLabel.init(null, "%", {top:"45px",left:"215px",width:"20px",textAlign:"left"}));

}

function createTfxx() {
	var chkTfxx1Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_IGNORERESERVE)){
		if(paramList[0].DSED_IGNORERESERVE == 0){
			chkTfxx1Checked = false;
		}
	}
	var chkTfxx1 = JyyCheckBox.init(null, chkTfxx1Checked, "1", "调峰或备用不足时去除备用", {top:"15px",left:"20px",width:"240px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_IGNORERESERVE = 1;
		}else if(param.checked == false){
			paramList[0].DSED_IGNORERESERVE = 0;
		}
	});
	panel.appendChild(chkTfxx1);
	panel.appendChild(RxLabel.init(null, "当低谷负荷小于高峰负荷", {top:"45px",left:"20px",width:"180px",textAlign:"left"}));

	var txtCxyx1Checked = 70;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_DEEPREGULATIONLMT)){
		txtCxyx1Checked = (paramList[0].DSED_DEEPREGULATIONLMT*100).toFixed(2);
	}
	var txtCxyx1 = RxText.init(null, txtCxyx1Checked, "", {top:"45px",left:"200px",width:"50px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_DEEPREGULATIONLMT = param.value/100;
		}
	});
	panel.appendChild(txtCxyx1);
	panel.appendChild(RxLabel.init(null, "%时，启用如下深度调峰选项", {top:"45px",left:"255px",width:"220px",textAlign:"left"}));

	var group = createGroup("深度调峰选项", 75, 20, 525, 285, 96);
	panel.appendChild(group);

	var chkSdtf01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GTSTOPORDER)){
		if(paramList[0].DSED_GTSTOPORDER == -1){
			chkSdtf01Checked = false;
		}
	}
	var chkSdtf01 = JyyCheckBox.init(null, chkSdtf01Checked, "0", "燃机启停调峰", {top:"15px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_GTSTOPORDER = 1;
			lstSdtf01.checkNode(1, true);
			txtSdtf01.setReadOnly(false);
			txtSdtf01.input.style.color="#666666";
			drpSdtf01.input.style.color='#666666'
			drpSdtf01.style.pointerEvents='auto';
		}else if(param.checked == false){
			paramList[0].DSED_GTSTOPORDER = -1;
			txtSdtf01.setReadOnly(true);
			txtSdtf01.input.style.color="#c8c8c8";
			drpSdtf01.input.style.color='#c8c8c8'
			drpSdtf01.style.pointerEvents='none';
		}
	});
	group.addView(chkSdtf01);
	group.addView(RxLabel.init(null, "置燃机最小开机时间", {top:"45px",left:"20px",width:"160px",textAlign:"left"}));

	var txtSdtf01Checked = 6;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GTMINONTIME)){
		txtSdtf01Checked = paramList[0].DSED_GTMINONTIME;
	}
	var txtSdtf01 = RxText.init(null, txtSdtf01Checked, "", {top:"45px",left:"168px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_GTMINONTIME = param.value;
		}
	});
	var lstSdtf01 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		if(paramList[0].DSED_GTSTOPORDER != -1) {
			paramList[0].DSED_GTSTOPORDER = data.node.data.code;
		}
	});
	var drpSdtf01 = RxDropList.init(null, "", {list:lstSdtf01}, {position:'absolute', left:'440px', top:'45px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	txtSdtf01.setReadOnly(false);
	txtSdtf01.input.style.color="#666666";
	drpSdtf01.input.style.color='#666666'
	drpSdtf01.style.pointerEvents='auto';
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GTSTOPORDER)){
		if(paramList[0].DSED_GTSTOPORDER == -1){
			txtSdtf01.setReadOnly(true);
			txtSdtf01.input.style.color="#c8c8c8";
			drpSdtf01.input.style.color='#c8c8c8'
			drpSdtf01.style.pointerEvents='none';
		}
	}
	group.addView(txtSdtf01);
	group.addView(RxLabel.init(null, "小时", {top:"45px",left:"255px",width:"40px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"45px",left:"340px",width:"100px",textAlign:"left"}));
	group.addView(drpSdtf01);
	var lstSdtf01Checked = 1;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_GTSTOPORDER)){
		if(paramList[0].DSED_GTSTOPORDER == 2){
			lstSdtf01Checked = 2;
		}else if(paramList[0].DSED_GTSTOPORDER == 3){
			lstSdtf01Checked = 3;
		}else if(paramList[0].DSED_GTSTOPORDER == 4){
			lstSdtf01Checked = 4;
		}
	}
	lstSdtf01.checkNode(lstSdtf01Checked, true);

	var chkSdtf02Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALDEEPORDER)){
		if(paramList[0].DSED_THERMALDEEPORDER != -1){
			chkSdtf02Checked = true;
		}
	}
	var chkSdtf02 = JyyCheckBox.init(null, chkSdtf02Checked, "0", "火电出力深度调峰", {top:"75px",left:"20px",width:"160px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_THERMALDEEPORDER = 2;
			lstSdtf02.checkNode(2, true);
			txtSdtf02.setReadOnly(false);
			txtSdtf02.input.style.color="#666666";
			drpSdtf02.input.style.color='#666666'
			drpSdtf02.style.pointerEvents='auto';
		}else if(param.checked == false){
			paramList[0].DSED_THERMALDEEPORDER = -1;
			txtSdtf02.setReadOnly(true);
			txtSdtf02.input.style.color="#c8c8c8";
			drpSdtf02.input.style.color='#c8c8c8'
			drpSdtf02.style.pointerEvents='none';
		}
	});
	group.addView(chkSdtf02);
	group.addView(RxLabel.init(null, "火电机组最小负荷率", {top:"105px",left:"20px",width:"160px",textAlign:"left"}));

	var txtSdtf02Checked = 30;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALMINLOAD)){
		txtSdtf02Checked = paramList[0].DSED_THERMALMINLOAD*100;
	}
	var txtSdtf02 = RxText.init(null, txtSdtf02Checked, "", {top:"105px",left:"168px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_THERMALMINLOAD = param.value/100;
		}
	});
	group.addView(txtSdtf02);
	group.addView(RxLabel.init(null, "%", {top:"105px",left:"255px",width:"40px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"105px",left:"340px",width:"100px",textAlign:"left"}));
	var lstSdtf02 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		if(paramList[0].DSED_THERMALDEEPORDER != -1) {
			paramList[0].DSED_THERMALDEEPORDER = data.node.data.code;
		}
	});
	var drpSdtf02 = RxDropList.init(null, "", {list:lstSdtf02}, {position:'absolute', left:'440px', top:'105px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	txtSdtf02.setReadOnly(false);
	txtSdtf02.input.style.color="#666666";
	drpSdtf02.input.style.color='#666666'
	drpSdtf02.style.pointerEvents='auto';
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALDEEPORDER)){
		if(paramList[0].DSED_THERMALDEEPORDER == -1){
			txtSdtf02.setReadOnly(true);
			txtSdtf02.input.style.color="#c8c8c8";
			drpSdtf02.input.style.color='#c8c8c8'
			drpSdtf02.style.pointerEvents='none';
		}
	}
	group.addView(drpSdtf02);
	var lstSdtf02Checked = 2;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALDEEPORDER)){
		if(paramList[0].DSED_THERMALDEEPORDER == 1){
			lstSdtf02Checked = 1;
		}else if(paramList[0].DSED_THERMALDEEPORDER == 3){
			lstSdtf02Checked = 3;
		}else if(paramList[0].DSED_THERMALDEEPORDER == 4){
			lstSdtf02Checked = 4;
		}
	}
	lstSdtf02.checkNode(lstSdtf02Checked, true);

	var chkSdtf03Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALSTOPORDER)){
		if(paramList[0].DSED_THERMALSTOPORDER != -1){
			chkSdtf03Checked = true;
		}
	}
	var chkSdtf03 = JyyCheckBox.init(null, chkSdtf03Checked, "0", "火电启停调峰", {top:"135px",left:"20px",width:"140px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_THERMALSTOPORDER = 3;
			lstSdtf03.checkNode(3, true);
			txtSdtf03.setReadOnly(false);
			txtSdtf03.input.style.color="#666666";
			drpSdtf03.input.style.color='#666666'
			drpSdtf03.style.pointerEvents='auto';
		}else if(param.checked == false){
			paramList[0].DSED_THERMALSTOPORDER = -1;
			txtSdtf03.setReadOnly(true);
			txtSdtf03.input.style.color="#c8c8c8";
			drpSdtf03.input.style.color='#c8c8c8'
			drpSdtf03.style.pointerEvents='none';
		}
	});
	group.addView(chkSdtf03);
	group.addView(RxLabel.init(null, "机组容量不大于", {top:"165px",left:"20px",width:"120px",textAlign:"left"}));
	var txtSdtf03Checked = 300;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALCAPLMT)){
		txtSdtf03Checked = paramList[0].DSED_THERMALCAPLMT;
	}
	var txtSdtf03 = RxText.init(null, txtSdtf03Checked, "", {top:"165px",left:"138px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_THERMALCAPLMT = param.value;
		}
	});
	group.addView(txtSdtf03);
	group.addView(RxLabel.init(null, "MW参与启停", {top:"165px",left:"225px",width:"100px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"165px",left:"340px",width:"100px",textAlign:"left"}));
	var lstSdtf03 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		if(paramList[0].DSED_THERMALSTOPORDER != -1) {
			paramList[0].DSED_THERMALSTOPORDER = data.node.data.code;
		}
	});
	var drpSdtf03 = RxDropList.init(null, "", {list:lstSdtf03}, {position:'absolute', left:'440px', top:'165px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	txtSdtf03.setReadOnly(false);
	txtSdtf03.input.style.color="#666666";
	drpSdtf03.input.style.color='#666666'
	drpSdtf03.style.pointerEvents='auto';
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALSTOPORDER)){
		if(paramList[0].DSED_THERMALSTOPORDER == -1){
			txtSdtf03.setReadOnly(true);
			txtSdtf03.input.style.color="#c8c8c8";
			drpSdtf03.input.style.color='#c8c8c8'
			drpSdtf03.style.pointerEvents='none';
		}
	}
	group.addView(drpSdtf03);
	var lstSdtf03Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_THERMALSTOPORDER)){
		if(paramList[0].DSED_THERMALSTOPORDER == 1){
			lstSdtf03Checked = 1;
		}else if(paramList[0].DSED_THERMALSTOPORDER == 2){
			lstSdtf03Checked = 2;
		}else if(paramList[0].DSED_THERMALSTOPORDER == 4){
			lstSdtf03Checked = 4;
		}
	}
	lstSdtf03.checkNode(lstSdtf03Checked, true);

	var chkSdtf04Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_NUCLEARDEEPORDER)){
		if(paramList[0].DSED_NUCLEARDEEPORDER == -1){
			chkSdtf04Checked = false;
		}
	}
	var chkSdtf04 = JyyCheckBox.init(null, chkSdtf04Checked, "0", "核电机组出力深度调峰", {top:"225px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_NUCLEARDEEPORDER = 4;
			lstSdtf04.checkNode(4, true);
			drpSdtf04.input.style.color='#666666'
			drpSdtf04.style.pointerEvents='auto';
		}else if(param.checked == false){
			paramList[0].DSED_NUCLEARDEEPORDER = -1;
			drpSdtf04.input.style.color='#c8c8c8'
			drpSdtf04.style.pointerEvents='none';
		}
	});

	group.addView(chkSdtf04);
	group.addView(RxLabel.init(null, "对应调峰顺序", {top:"225px",left:"340px",width:"100px",textAlign:"left"}));
	var lstSdtf04 = RxTree.init(null, [{code:1,name:1},{code:2,name:2},{code:3,name:3},{code:4,name:4}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		if(paramList[0].DSED_NUCLEARDEEPORDER != -1) {
			paramList[0].DSED_NUCLEARDEEPORDER = data.node.data.code;
		}
	});
	var drpSdtf04 = RxDropList.init(null, "", {list:lstSdtf04}, {position:'absolute', left:'440px', top:'225px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	drpSdtf04.input.style.color='#666666'
	drpSdtf04.style.pointerEvents='auto';
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_NUCLEARDEEPORDER)){
		if(paramList[0].DSED_NUCLEARDEEPORDER == -1){
			drpSdtf04.input.style.color='#c8c8c8'
			drpSdtf04.style.pointerEvents='none';
		}
	}
	group.addView(drpSdtf04);
	var lstSdtf04Checked = 4;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_NUCLEARDEEPORDER)){
		if(paramList[0].DSED_NUCLEARDEEPORDER == 1){
			lstSdtf04Checked = 1;
		}else if(paramList[0].DSED_NUCLEARDEEPORDER == 2){
			lstSdtf04Checked = 2;
		}else if(paramList[0].DSED_NUCLEARDEEPORDER == 3){
			lstSdtf04Checked = 3;
		}
	}
	lstSdtf04.checkNode(lstSdtf04Checked, true);
}

function createJxxx() {
	var group = createGroup("机组检修", 10, 20, 580, 190);
	panel.appendChild(group);

	var rdoJxxx01Checked = false;
	var rdoJxxx02Checked = true;
	var rdoJxxx03Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUNUMT)){
		if(paramList[0].DSED_RUNUMT == 0){
			rdoJxxx01Checked = true;
			rdoJxxx02Checked = false;
			rdoJxxx03Checked = false;
		}else if(paramList[0].DSED_RUNUMT == 2){
			rdoJxxx01Checked = false;
			rdoJxxx02Checked = false;
			rdoJxxx03Checked = true;
		}
	}
	var rdoJxxx01 = JyyRadio.init(null, "t5g1", rdoJxxx01Checked,  "0", "不考虑检修", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].DSED_RUNUMT = 0;
		rdoJxxx11.disable(true);
		rdoJxxx12.disable(true);
		rdoJxxx13.disable(true);
		rdoJxxx21.disable(true);
		rdoJxxx22.disable(true);
	});
	var rdoJxxx02 = JyyRadio.init(null, "t5g1", rdoJxxx02Checked, "1", "全局优化检修", {top:"15px",left:"160px",width:"140px"}, function(param){
		paramList[0].DSED_RUNUMT = 1;
		rdoJxxx11.disable(false);
		rdoJxxx12.disable(false);
		rdoJxxx13.disable(false);
		rdoJxxx21.disable(false);
		rdoJxxx22.disable(false);
	});
	var rdoJxxx03 = JyyRadio.init(null, "t5g1", rdoJxxx03Checked, "2", "启发式优化检修", {top:"15px",left:"300px",width:"140px"}, function(param){
		paramList[0].DSED_RUNUMT = 2;
		rdoJxxx11.disable(false);
		rdoJxxx12.disable(false);
		rdoJxxx13.disable(false);
		rdoJxxx21.disable(false);
		rdoJxxx22.disable(false);
	});
	group.addView(rdoJxxx01);
	group.addView(rdoJxxx02);
	group.addView(rdoJxxx03);

	group.addView(RxLabel.init(null, "检修目标：", {top:"45px",left:"20px",width:"100px",textAlign:"left"}));

	var rdoJxxx11Checked = true;
	var rdoJxxx12Checked = false;
	var rdoJxxx13Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_UMTMETHOD)){
		if(paramList[0].DSED_UMTMETHOD == 1){
			rdoJxxx11Checked = false;
			rdoJxxx12Checked = true;
			rdoJxxx13Checked = false;
		}else if(paramList[0].DSED_UMTMETHOD == 2){
			rdoJxxx11Checked = false;
			rdoJxxx12Checked = false;
			rdoJxxx13Checked = true;
		}
	}
	var rdoJxxx11 = JyyRadio.init(null, "t5g2", rdoJxxx11Checked,  "0", "等备用", {top:"75px",left:"20px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMETHOD = 0;
	});
	var rdoJxxx12 = JyyRadio.init(null, "t5g2", rdoJxxx12Checked, "1", "等备用率", {top:"75px",left:"160px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMETHOD = 1;
	});
	var rdoJxxx13 = JyyRadio.init(null, "t5g2", rdoJxxx13Checked, "2", "等风险度", {top:"75px",left:"300px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMETHOD = 2;
	});
	rdoJxxx11.disable(false);
	rdoJxxx12.disable(false);
	rdoJxxx13.disable(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUNUMT)){
		if(paramList[0].DSED_RUNUMT == 0){
			rdoJxxx11.disable(true);
			rdoJxxx12.disable(true);
			rdoJxxx13.disable(true);
		}
	}
	group.addView(rdoJxxx11);
	group.addView(rdoJxxx12);
	group.addView(rdoJxxx13);

	group.addView(RxLabel.init(null, "检修方式：", {top:"105px",left:"20px",width:"100px",textAlign:"left"}));

	var rdoJxxx21Checked = true;
	var rdoJxxx22Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_UMTMEAN)){
		if(paramList[0].DSED_UMTMEAN == 1){
			rdoJxxx21Checked = false;
			rdoJxxx22Checked = true;
		}
	}
	var rdoJxxx21 = JyyRadio.init(null, "t5g3", rdoJxxx21Checked,  "0", "按等效检修天数安排", {top:"135px",left:"20px",width:"170px"}, function(param){
		paramList[0].DSED_UMTMEAN = 0;
	});
	var rdoJxxx22 = JyyRadio.init(null, "t5g3", rdoJxxx22Checked, "1", "考虑机组大小修", {top:"135px",left:"300px",width:"140px"}, function(param){
		paramList[0].DSED_UMTMEAN = 1;
	});
	rdoJxxx21.disable(false);
	rdoJxxx22.disable(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_RUNUMT)){
		if(paramList[0].DSED_RUNUMT == 0){
			rdoJxxx21.disable(true);
			rdoJxxx22.disable(true);
		}
	}
	group.addView(rdoJxxx21);
	group.addView(rdoJxxx22);

	group = createGroup("线路检修", 210, 20, 580, 68);
	panel.appendChild(group);
	//未找到对应字段
	var chkJxxx01 = JyyCheckBox.init(null, false, "0", "考虑线路检修", {top:"15px",left:"20px",width:"140px"}, function(param){
		console.log(param);
	});
	group.addView(chkJxxx01);
}
function createSdyxxx() {
	var group = createGroup("水电运行方式", 10, 20, 580, 130, 96);
	panel.appendChild(group);

	var chkSdyx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIRCOR)){
		if(paramList[0].LTHS_RESERVOIRCOR == 0){
			chkSdyx01Checked = false;
		}
	}
	var chkSdyx01 = JyyCheckBox.init(null, chkSdyx01Checked, "1", "考虑梯级电站协调", {top:"15px",left:"20px",width:"180px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_RESERVOIRCOR = 1;
		}else if(param.checked == false){
			paramList[0].LTHS_RESERVOIRCOR = 0;
		}
	});
	group.addView(chkSdyx01);

	var chkSdyx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_HYDROLIMIT)){
		if(paramList[0].LTHS_HYDROLIMIT == 0){
			chkSdyx02Checked = false;
		}
	}
	var chkSdyx02 = JyyCheckBox.init(null, chkSdyx02Checked, "1", "是否考虑跨流域之间协调", {top:"15px",left:"220px",width:"220px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_HYDROLIMIT = 1;
			txtSdyx01.setReadOnly(false);
			txtSdyx01.input.style.color="#666666";
			txtSdyx02.setReadOnly(false);
			txtSdyx02.input.style.color="#666666";
		}else if(param.checked == false){
			paramList[0].LTHS_HYDROLIMIT = 0;
			txtSdyx01.setReadOnly(true);
			txtSdyx01.input.style.color="#c8c8c8";
			txtSdyx02.setReadOnly(true);
			txtSdyx02.input.style.color="#c8c8c8";
		}
	});
	group.addView(chkSdyx02);

	var chkSdyx03Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_WATERMAX)){
		if(paramList[0].LTHS_WATERMAX == 0){
			chkSdyx03Checked = false;
		}
	}
	var chkSdyx03 = JyyCheckBox.init(null, chkSdyx03Checked, "1", "考虑水库最大用水量", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_WATERMAX = 1;
		}else if(param.checked == false){
			paramList[0].LTHS_WATERMAX = 0;
		}
	});
	group.addView(chkSdyx03);
	group.addView(RxLabel.init(null, "出力总和最大出力", {top:"45px",left:"220px",width:"140px",textAlign:"left"}));

	var txtSdyx01Checked = 100;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_LIMITHIGH)){
		txtSdyx01Checked = paramList[0].LTHS_LIMITHIGH*100;
	}
	var txtSdyx01 = RxText.init(null, txtSdyx01Checked, "", {top:"45px",left:"353px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_LIMITHIGH = param.value/100;
		}
	});
	group.addView(txtSdyx01);
	group.addView(RxLabel.init(null, "%　总负荷", {top:"45px",left:"440px",width:"80px",textAlign:"left"}));

	var chkSdyx04Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIREVAPO)){
		if(paramList[0].LTHS_RESERVOIREVAPO == 0){
			chkSdyx04Checked = false;
		}
	}
	var chkSdyx04 = JyyCheckBox.init(null, chkSdyx04Checked, "0", "考虑水库蒸发", {top:"75px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_RESERVOIREVAPO = 1;
		}else if(param.checked == false){
			paramList[0].LTHS_RESERVOIREVAPO = 0;
		}
	});
	group.addView(chkSdyx04);
	group.addView(RxLabel.init(null, "出力总和最小出力", {top:"75px",left:"220px",width:"140px",textAlign:"left"}));

	var txtSdyx02Checked = 0;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_LIMITLOW)){
		txtSdyx02Checked = paramList[0].LTHS_LIMITLOW*100;
	}
	var txtSdyx02 = RxText.init(null, txtSdyx02Checked, "", {top:"75px",left:"353px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_LIMITLOW = param.value/100;
		}
	});
	txtSdyx01.setReadOnly(false);
	txtSdyx01.input.style.color="#666666";
	txtSdyx02.setReadOnly(false);
	txtSdyx02.input.style.color="#666666";
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_HYDROLIMIT)){
		if(paramList[0].LTHS_HYDROLIMIT == 0){
			txtSdyx01.setReadOnly(true);
			txtSdyx01.input.style.color="#c8c8c8";
			txtSdyx02.setReadOnly(true);
			txtSdyx02.input.style.color="#c8c8c8";
		}
	}
	group.addView(txtSdyx02);
	group.addView(RxLabel.init(null, "%　总负荷", {top:"75px",left:"440px",width:"80px",textAlign:"left"}));

	group = createGroup("水电优化目标", 150, 20, 580, 65, 96);
	panel.appendChild(group);

	var rdoSdyx01Checked = true;
	var rdoSdyx02Checked = false;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_GOALSTYLE)){
		if(paramList[0].LTHS_GOALSTYLE == 1){
			rdoSdyx01Checked = false;
			rdoSdyx02Checked = true;
		}
	}
	var rdoSdyx01 = JyyRadio.init(null, "t6g1", rdoSdyx01Checked,  "0", "考虑水电调峰效益", {top:"15px",left:"20px",width:"160px"}, function(param){
		paramList[0].LTHS_GOALSTYLE = 0;
	});
	var rdoSdyx02 = JyyRadio.init(null, "t6g1", rdoSdyx02Checked, "1", "水电发电量最大化", {top:"15px",left:"220px",width:"160px"}, function(param){
		paramList[0].LTHS_GOALSTYLE = 1;
	});
	group.addView(rdoSdyx01);
	group.addView(rdoSdyx02);

	group = createGroup("水电模拟选项", 225, 20, 580, 100, 96);
	panel.appendChild(group);

	var chkSdyx05Checked = true;
	var chkSdyx06Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_HYDRODIVNUM)){
		if(paramList[0].LTHS_HYDRODIVNUM == 1){
			chkSdyx05Checked = false;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIRDIVNUM)){
		if(paramList[0].LTHS_RESERVOIRDIVNUM == 1){
			chkSdyx06Checked = false;
		}
	}
	var chkSdyx05 = JyyCheckBox.init(null, chkSdyx05Checked, "1", "是否考虑水电出力非线性", {top:"15px",left:"20px",width:"201px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_HYDRODIVNUM = 3;
			txtSdyx03.setReadOnly(false);
			txtSdyx03.input.style.color="#666666";
		}else if(param.checked == false){
			paramList[0].LTHS_HYDRODIVNUM = 1;
			txtSdyx03.setReadOnly(true);
			txtSdyx03.input.style.color="#c8c8c8";
		}
	});
	group.addView(chkSdyx05);
	var chkSdyx06 = JyyCheckBox.init(null, chkSdyx06Checked, "1", "是否考虑水头非线性", {top:"15px",left:"220px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].LTHS_RESERVOIRDIVNUM = 3;
			txtSdyx04.setReadOnly(false);
			txtSdyx04.input.style.color="#666666";
		}else if(param.checked == false){
			paramList[0].LTHS_RESERVOIRDIVNUM = 1;
			txtSdyx04.setReadOnly(true);
			txtSdyx04.input.style.color="#c8c8c8";
		}
	});
	group.addView(chkSdyx06);
	group.addView(RxLabel.init(null, "线性化", {top:"45px",left:"20px",width:"60px",textAlign:"left"}));

	var txtSdyx03Checked = 3;
	var txtSdyx04Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_HYDRODIVNUM)){
		if(paramList[0].LTHS_HYDRODIVNUM != 1){
			txtSdyx03Checked = paramList[0].LTHS_HYDRODIVNUM;
		}
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIRDIVNUM)){
		if(paramList[0].LTHS_RESERVOIRDIVNUM != 1){
			txtSdyx04Checked = paramList[0].LTHS_RESERVOIRDIVNUM;
		}
	}
	var txtSdyx03 = RxText.init(null, txtSdyx03Checked, "", {top:"45px",left:"75px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_HYDRODIVNUM = param.value;
		}
	});
	txtSdyx03.setReadOnly(false);
	txtSdyx03.input.style.color="#666666";
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_HYDRODIVNUM)){
		if(paramList[0].LTHS_HYDRODIVNUM == 1){
			txtSdyx03.setReadOnly(true);
			txtSdyx03.input.style.color="#c8c8c8";
		}
	}
	group.addView(txtSdyx03);
	group.addView(RxLabel.init(null, "段", {top:"45px",left:"163px",width:"80px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "线性化", {top:"45px",left:"220px",width:"60px",textAlign:"left"}));
	var txtSdyx04 = RxText.init(null, txtSdyx04Checked, "", {top:"45px",left:"275px",width:"80px"},function(param){
		if(param.name == "onchange"){
			paramList[0].LTHS_RESERVOIRDIVNUM = param.value;
		}
	});
	txtSdyx04.setReadOnly(false);
	txtSdyx04.input.style.color="#666666";
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].LTHS_RESERVOIRDIVNUM)){
		if(paramList[0].LTHS_RESERVOIRDIVNUM == 1){
			txtSdyx04.setReadOnly(true);
			txtSdyx04.input.style.color="#c8c8c8";
		}
	}
	group.addView(txtSdyx04);
	group.addView(RxLabel.init(null, "段", {top:"45px",left:"363px",width:"80px",textAlign:"left"}));
}

function createXnyyxxx() {
	var group = createGroup("风电选项", 10, 20, 580, 255);
	panel.appendChild(group);

	var cggroup = createGroup("常规选项", 25, 20, 240, 210);
	group.appendChild(cggroup);

	var chkFdxx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_WINDCORR)){
		if(paramList[0].WPOS_WINDCORR == 0){
			chkFdxx01Checked = false;
		}
	}
	var chkFdxx01 = JyyCheckBox.init(null, chkFdxx01Checked, "1", "考虑风电场空间相关性", {top:"15px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_WINDCORR = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_WINDCORR = 0;
		}
	});
	cggroup.addView(chkFdxx01);

	var chkFdxx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RELIABILITY)){
		if(paramList[0].WPOS_RELIABILITY == 0){
			chkFdxx02Checked = false;
		}
	}
	var chkFdxx02 = JyyCheckBox.init(null, chkFdxx02Checked, "1", "考虑风电机组可靠性", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_RELIABILITY = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_RELIABILITY = 0;
		}
	});
	cggroup.addView(chkFdxx02);

	var chkFdxx03Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_WAKEEFFECT)){
		if(paramList[0].WPOS_WAKEEFFECT == 0){
			chkFdxx03Checked = false;
		}
	}
	var chkFdxx03 = JyyCheckBox.init(null, chkFdxx03Checked, "1", "考虑风电场尾流效应", {top:"75px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_WAKEEFFECT = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_WAKEEFFECT = 0;
		}
	});
	cggroup.addView(chkFdxx03);

	var chkFdxx04Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_DAYRHYTHM)){
		if(paramList[0].WPOS_DAYRHYTHM == 0){
			chkFdxx04Checked = false;
		}
	}
	var chkFdxx04 = JyyCheckBox.init(null, chkFdxx04Checked, "1", "考虑风速日特性", {top:"105px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_DAYRHYTHM = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_DAYRHYTHM = 0;
		}
	});
	cggroup.addView(chkFdxx04);

	var chkFdxx05Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_SEASONRHYTHM)){
		if(paramList[0].WPOS_SEASONRHYTHM == 0){
			chkFdxx05Checked = false;
		}
	}
	var chkFdxx05 = JyyCheckBox.init(null, chkFdxx05Checked, "1", "考虑风速季节特性", {top:"135px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].WPOS_SEASONRHYTHM = 1;
		}else if(param.checked == false){
			paramList[0].WPOS_SEASONRHYTHM = 0;
		}
	});
	cggroup.addView(chkFdxx05);

	var msgroup = createGroup("风机功率特性曲线模式", 25, 280, 240, 100, 160);
	group.appendChild(msgroup);

	var rdoFdxx01Checked = false;
	var rdoFdxx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_POWERCURVE)){
		if(paramList[0].WPOS_POWERCURVE == 0){
			rdoFdxx01Checked = true;
			rdoFdxx02Checked = false;
		}
	}
	var rdoFdxx01 = JyyRadio.init(null, "t7g1", rdoFdxx01Checked,  "0", "直线型", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_POWERCURVE = 0;
	});
	msgroup.addView(rdoFdxx01);
	var rdoFdxx02 = JyyRadio.init(null, "t7g1", rdoFdxx02Checked, "1", "三次曲线型", {top:"45px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_POWERCURVE = 1;
	});
	msgroup.addView(rdoFdxx02);

	var sjgroup = createGroup("随机数选项", 135, 280, 240, 100, 82);
	group.appendChild(sjgroup);

	var rdoFdxx11Checked = false;
	var rdoFdxx12Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMTYPE)){
		if(paramList[0].WPOS_RAMDOMTYPE == 0){
			rdoFdxx11Checked = true;
			rdoFdxx12Checked = false;
		}
	}
	var rdoFdxx11 = JyyRadio.init(null, "t7g2", rdoFdxx11Checked,  "0", "随机种子", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_RAMDOMTYPE = 0;
		txtFdxx01.setReadOnly(true);
		rdoFdxx12.label.style.color = '#c6c6c6';
	});
	sjgroup.addView(rdoFdxx11);
	var rdoFdxx12 = JyyRadio.init(null, "t7g2", rdoFdxx12Checked, "1", "固定种子：", {top:"45px",left:"20px",width:"140px"}, function(param){
		paramList[0].WPOS_RAMDOMTYPE = 1;
		txtFdxx01.setReadOnly(false);
		rdoFdxx12.label.style.color = '#666666';
	});
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMTYPE)){
		if(paramList[0].WPOS_RAMDOMTYPE == 0){
			rdoFdxx12.label.style.color = '#c6c6c6';
		}
	}
	sjgroup.addView(rdoFdxx12);

	var txtFdxx01Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMSEED)){
		txtFdxx01Checked = paramList[0].WPOS_RAMDOMSEED;
	}
	var txtFdxx01 = RxText.init(null, txtFdxx01Checked, "", {top:"45px",left:"120px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].WPOS_RAMDOMSEED = param.value;
		}
	});
	txtFdxx01.setReadOnly(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].WPOS_RAMDOMTYPE)){
		if(paramList[0].WPOS_RAMDOMTYPE == 0){
			txtFdxx01.setReadOnly(true);
		}
	}
	sjgroup.addView(txtFdxx01);

	group = createGroup("光伏选项", 275, 20, 580, 145);
	panel.appendChild(group);

	cggroup = createGroup("常规选项", 25, 20, 240, 100);
	group.appendChild(cggroup);

	var chkGfxx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_PVCORR)){
		if(paramList[0].PVOS_PVCORR == 0){
			chkGfxx01Checked = false;
		}
	}
	var chkGfxx01 = JyyCheckBox.init(null, chkGfxx01Checked, "1", "考虑光伏电站空间相关性", {top:"15px",left:"20px",width:"205px"}, function(param){
		if(param.checked == true){
			paramList[0].PVOS_PVCORR = 1;
		}else if(param.checked == false){
			paramList[0].PVOS_PVCORR = 0;
		}
	});
	cggroup.addView(chkGfxx01);

	var chkGfxx02Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RELIABILITY)){
		if(paramList[0].PVOS_RELIABILITY == 0){
			chkGfxx02Checked = false;
		}
	}
	var chkGfxx02 = JyyCheckBox.init(null, chkGfxx02Checked, "1", "考虑光伏阵列可靠性", {top:"45px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].PVOS_RELIABILITY = 1;
		}else if(param.checked == false){
			paramList[0].PVOS_RELIABILITY = 0;
		}
	});
	cggroup.addView(chkGfxx02);

	sjgroup = createGroup("随机数选项", 25, 280, 240, 100, 82);
	group.appendChild(sjgroup);

	var rdoGfxx11Checked = false;
	var rdoGfxx12Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMTYPE)){
		if(paramList[0].PVOS_RAMDOMTYPE == 0){
			rdoGfxx11Checked = true;
			rdoGfxx12Checked = false;
		}
	}
	var rdoGfxx11 = JyyRadio.init(null, "t7g3", rdoGfxx11Checked,  "0", "随机种子", {top:"15px",left:"20px",width:"140px"}, function(param){
		paramList[0].PVOS_RAMDOMTYPE = 0;
		txtGfxx01.setReadOnly(true);
		rdoGfxx12.label.style.color = '#c6c6c6';
	});
	sjgroup.addView(rdoGfxx11);
	var rdoGfxx12 = JyyRadio.init(null, "t7g3", rdoGfxx12Checked, "1", "固定种子：", {top:"45px",left:"20px",width:"140px"}, function(param){
		paramList[0].PVOS_RAMDOMTYPE = 1;
		txtGfxx01.setReadOnly(false);
		rdoGfxx12.label.style.color = '#666666';
	});
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMTYPE)){
		if(paramList[0].PVOS_RAMDOMTYPE == 0){
			rdoGfxx12.label.style.color = '#c6c6c6';
		}
	}
	sjgroup.addView(rdoGfxx12);

	var txtGfxx01Checked = 3;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMSEED)){
		txtGfxx01Checked = paramList[0].PVOS_RAMDOMSEED;
	}
	var txtGfxx01 = RxText.init(null, txtGfxx01Checked, "", {top:"45px",left:"120px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].PVOS_RAMDOMSEED = param.value;
		}
	});
	txtGfxx01.setReadOnly(false);
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].PVOS_RAMDOMTYPE)){
		if(paramList[0].PVOS_RAMDOMTYPE == 0){
			txtGfxx01.setReadOnly(true);
		}
	}
	sjgroup.addView(txtGfxx01);
}

function createYhxx() {
	var group = createGroup("程序诊断选项", 10, 20, 300, 100, 96);
	panel.appendChild(group);

	var chkYhxx01Checked = true;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_CONSOLE)){
		if(paramList[0].DSED_CONSOLE == 0){
			chkYhxx01Checked = false;
		}
	}
	var chkYhxx01 = JyyCheckBox.init(null, chkYhxx01Checked, "1", "显示控制台", {top:"15px",left:"20px",width:"200px"}, function(param){
		if(param.checked == true){
			paramList[0].DSED_CONSOLE = 1;
		}else if(param.checked == false){
			paramList[0].DSED_CONSOLE = 0;
		}
	});
	group.addView(chkYhxx01);
	group.addView(RxLabel.init(null, "控制台调试信息等级", {top:"45px",left:"40px",width:"150px",textAlign:"left"}));
	var lstYhxx01 = RxTree.init(null, [{code:0,name:0},{code:1,name:1},{code:2,name:2},{code:3,name:3}], {listMode:'listbox', isMenu:true}, {height:'112px'}, function(data){
		paramList[0].DSED_MSGLEV = data.node.data.code;
	});
	var drpYhxx01 = RxDropList.init(null, "", {list:lstYhxx01}, {position:'absolute', left:'190px', top:'45px', width:'60px', height:'24px'}, function(data) {
		return true;
	});
	group.addView(drpYhxx01);

	var lstYhxx01Checked = 1;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_MSGLEV)){
		if(paramList[0].DSED_MSGLEV == 0){
			lstYhxx01Checked = 0;
		}else if(paramList[0].DSED_MSGLEV == 2){
			lstYhxx01Checked = 2;
		}else if(paramList[0].DSED_MSGLEV == 3){
			lstYhxx01Checked = 3;
		}
	}
	lstYhxx01.checkNode(lstYhxx01Checked, true);
	group = createGroup("程序优化核心选项", 120, 20, 300, 130, 128);
	panel.appendChild(group);
	group.addView(RxLabel.init(null, "计算时间限制", {top:"15px",left:"20px",width:"100px",textAlign:"left"}));

	var txtYhxx01Checked = 5;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_TIMEOUT)){
		txtYhxx01Checked = paramList[0].DSED_TIMEOUT;
	}
	var txtYhxx01 = RxText.init(null, txtYhxx01Checked, "", {top:"15px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_TIMEOUT = param.value;
		}
	});
	group.addView(txtYhxx01);
	group.addView(RxLabel.init(null, "秒", {top:"15px",left:"230px",width:"40px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "最大迭代次数", {top:"45px",left:"20px",width:"100px",textAlign:"left"}));
	var txtYhxx02Checked = 3000;
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_MAXITERATIONS)){
		txtYhxx02Checked = paramList[0].DSED_MAXITERATIONS;
	}
	var txtYhxx02 = RxText.init(null, txtYhxx02Checked, "", {top:"45px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_MAXITERATIONS = param.value;
		}
	});
	group.addView(txtYhxx02);
	group.addView(RxLabel.init(null, "次", {top:"45px",left:"230px",width:"80px",textAlign:"left"}));
	group.addView(RxLabel.init(null, "优化计算间隙", {top:"75px",left:"20px",width:"100px",textAlign:"left"}));
	var txtYhxx03Checked = 0.01;
	if (intcont==0){
		var l = paramList[0].DSED_PRECISION*100;
		paramList[0].DSED_PRECISION =l;
		intcont++;
	}
	if(paramList.length > 0 && !JyyCommon.isEmpty(paramList[0].DSED_PRECISION)){
		txtYhxx03Checked = paramList[0].DSED_PRECISION;
	}
	var txtYhxx03 = RxText.init(null, txtYhxx03Checked, "", {top:"75px",left:"122px",width:"100px"},function(param){
		if(param.name == "onchange"){
			paramList[0].DSED_PRECISION = param.value;
		}
	});
	group.addView(txtYhxx03);
	group.addView(RxLabel.init(null, "%", {top:"75px",left:"230px",width:"80px",textAlign:"left"}));
}

function createGroup(text, top, left, width, height, textWidth) {
	var ctrl = document.createElement("div");
	ctrl.className = "gopt_group";
	ctrl.style.top = top + "px";
	ctrl.style.left = left + "px";
	ctrl.style.width = width + "px";
	ctrl.style.height = height + "px";
	ctrl.panel = document.createElement("div");
	ctrl.panel.className = "gopt_group_panel";
	ctrl.appendChild(ctrl.panel);
	ctrl.text = document.createElement("div");
	ctrl.text.className = "gopt_group_text";
	ctrl.text.innerHTML = text;
	if (textWidth !== undefined) {
		ctrl.text.style.width = textWidth + "px";
	}
	ctrl.appendChild(ctrl.text);

	ctrl.addView = function(view) {
		ctrl.panel.appendChild(view);
	};

	return ctrl;
}

//模拟参数
var sps = {
	base:{//基本参数
		plan: [
			{
				id:0,
				name:"方案MMMMMM"
			}
		],
		etime: {//评估时间
			formDate:"2019-03-19",
			toDate:"2019-03-19"
		},
		scene: {//典型场景选择
			way:1,//0,1,2
			type:[1,1,1,1]
		}
	},
	run: {
	}
};
function resizeAddPlanPage() {
	var panel = $('#viewPanel')[0];
	var panelWidth = $('#viewPanel').width();
	var panelHeight = $('#viewPanel').height();
	$('#planPanel').css({top:((panelHeight-350)/2)+"px",left:((panelWidth-600)/2)+"px"});
}
function resizeRunPage() {
	var panel = $('#viewPanel')[0];
	var panelWidth = $('#viewPanel').width();
	var panelHeight = $('#viewPanel').height();
	$('#runPanel').css({top:((panelHeight-615)/2)+"px",left:((panelWidth-915)/2)+"px"});
	$('#runProcessPanel').css({top:((panelHeight-340)/2)+"px",left:((panelWidth-670)/2)+"px"});
}

function setChecked(obj, value){
	if(value == 1){
		obj.onclick();
	}
}

var timer = null;
var loopCount = 0;
function showProcessBar() {
	var n = 40;
	$("#runProcessPanel").show();
	loopCount = 0;
	timer = setInterval(function() {
		loopCount = loopCount + 1;
		var width = parseInt(loopCount*610/n);
		if (width > 610) {
			width = 610;
		}
		$("#processBar").width(width);
		$("#processBar").text(parseInt(width*100/610) +"%　");
		if (loopCount > (n+6)) {
			hideProcessBar();
		}
	}, 500);
}
function addDate(d){
	d = new Date(d);
	d = +d + 1000*60*60*24;
	d = new Date(d);
	//return d;
	//格式化
	return d.getFullYear().toString()+getFormatDate((d.getMonth()+1))+getFormatDate(d.getDate());

}
function subDate(d){
	d = new Date(d);
	d = +d - 1000*60*60*24;
	d = new Date(d);
	//return d;
	//格式化
	return d.getFullYear().toString()+getFormatDate((d.getMonth()+1))+getFormatDate(d.getDate());

}
function setDate(d){
	d = new Date(d);
	return d.getFullYear().toString()+getFormatDate((d.getMonth()+1))+getFormatDate(d.getDate());

}
function getFormatDate(arg) {
	if (arg == undefined || arg == '') {
		return '';
	}

	var re = arg + '';
	if (re.length < 2) {
		re = '0' + re;
	}

	return re;
}
function hideProcessBar() {
	if (timer) {
		clearInterval(timer);
	}
	loopCount = 0;
	$("#wizardMask").hide();
	$("#runProcessPanel").hide();
}

function getParams(){
	$.ajax({
		async:false,
		url:"work/getParams",
		type:"POST",
		data:{"projectid":planId},
		success:function(res){
			paramList = res.result;
		}
	});
};
function killNowTask(taskid){
	var method ='killNowTask';
	invoke(method, {modelId:modelId,taskid:taskid}, function(data){
		refreshProtasktList();
	});
};
function killTasklist(taskid){
	var method ='killTasklist';
	invoke(method, {modelId:modelId,taskid:taskid}, function(data){
		refreshProtasktList();
	});
};
function delWaitTask(taskid){
	var method ='delWaitTask';
	invoke(method, {modelId:modelId,taskid:taskid}, function(data){
		refreshProtasktList();
	});
};
function showProlist(){
	$('#progressDiv').show();
	$('#progressDiv').draggable();
	$('#heideProesslist').hide();
}
function showProPanl(){
	refreshProtasktList();
	refreshProtasktHList();
	$('#progressList').show();
	$('#progressList').draggable({cancel: "div[lay-filter='docDemoTabBrief']"});
};
function getstate(){
	$('#progressClose').click(function(){
		$('#progressDiv').hide();
		clearInterval(t_setInterval);
	});

	$('#progressDiv').show();
	$('#progressDiv').draggable();

	t_setInterval = setInterval(function(){
		$.ajax({
			dataType: "json",
			data:{planId:data.id},
			url: 'executive/getProgressInfoYX'
		}).done(function(res) {
			var r = eval("("+res.result+")");
			$('#progressStrip').css({width:r.progressBar+"%"});
			$('#progressStrip').find("span").text(r.progressBar + "%");
			$('#progressText').html(r.result);
			$('#progressText')[0].scrollTop = $('#progressText')[0].scrollHeight;
			$("#progressState").setStep(r.progressState);
		});
	}, 1000);
};
function refreshProtasktList() {
	var tableData = [];
	var L_modelName =$('#L_modelName').val();
	var L_projectName =$('#L_projectName').val();
	var L_planName =$('#L_planName').val();
	if(L_modelName=='模块名称'){
		L_modelName  ='';
	}
	if(L_projectName=='工程名称'){
		L_projectName  ='';
	}
	if(L_planName=='方案名称'){
		L_planName  ='';
	}
	var data =  invoke('getRunList', {modelName:L_modelName,projectName:L_projectName,planName:L_planName}).respData;

	for(var i=0;i<data.length;i++){
		tableData.push({"sortNo":data[i].sortNo,
			"id":data[i].id,
			"modelName": data[i].modelName,
			"proName":data[i].proName,
			"planName": data[i].planName,
			"starttime": data[i].starttime,
			"state": data[i].state
			,"jd": data[i].jd,"taskid": data[i].taskid})
	}
	layui.use(['table','element','layer'], function(){
		var table = layui.table;
		var element = layui.element;
		var layer = layui.layer;
		var nowCurr = 1;
		var nowCount = 0;
		var tabrender = table.render({
			elem: '#test',
			width:1180,
			height:225
			,defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
				title: '提示'
				,layEvent: 'LAYTABLE_TIPS'
				,icon: 'layui-icon-tips'
			}]
			,title: '用户数据表',
			limit: 50
			,cols: [[{field:'sortNo', title:'序号', width:'6%',align: 'center'},
				{field:'id', title:'工程名称',hide:true,align: 'center'},
				{field:'modelName', title:'模块名称', width:'12%',align: 'center'},
				{field:'proName', title:'工程名称', width:'13%',align: 'center'},
				{field:'planName', title:'方案名称', width:'12%',align: 'center'},
				{field:'starttime', title:'启动时间', width:'15%',align: 'center'},
				{field:'state', title:'状态', width:'9%',align: 'center'},/*
			    	{fixed: 'right', title:'操作', toolbar: '#barDemo', width:'40%',align: 'center'},*/
				{field: 'jd', title: '计算进度',width:'25%', align: 'center',templet:function(d){
						var hp = 0;
						if(d.modelName=='源网储一体化规划'){
							hp = 50*d.jd;
						}else{
							hp = 0.14*d.jd;
							hp =hp.toFixed(1);
							hp =hp*100;
						}
						if(hp>100){
							hp =100;
						}
						let result = "";
						if(d.state=='正在计算' && d.modelName=='调度运行模拟') {
							result = '<div class="layui-progress layui-progress-big" lay-filter="progress0" lay-showpercent="true"><div class="layui-progress-bar layui-bg-orange" lay-percent="'+hp+'%"></div></div><br>';
						} else if(d.state=='正在计算' && d.modelName=='dat转换') {
							result = '<div class="layui-progress layui-progress-big" lay-filter="progress100" lay-showpercent="true"><div class="layui-progress-bar layui-bg-orange" lay-percent="'+hp+'%"></div></div><br>';
						} else if(d.state=='正在计算' && d.modelName=='源网储一体化规划') {
							result = '<div class="layui-progress layui-progress-big" lay-filter="progress2" lay-showpercent="true"><div class="layui-progress-bar layui-bg-orange" lay-percent="'+hp+'%"></div></div><br>';
						} else  {
							result = '<div class="layui-progress layui-progress-big"   lay-showpercent="true"><div class="layui-progress-bar layui-bg-orange" lay-percent="'+hp+'%"></div></div><br>';
						}
						return result;
					}},
				{field: 'cz', title: '操作',width:'8%',templet:function(d){
						let result = "";
						if(d.state=='正在计算'){
							result = '<a class="layui-btn layui-btn-xs" lay-event="kill"  style="background-color: #557DFF;width: 60px;color:white;">终止</a>'
						}else{
							result = '<a class="layui-btn layui-btn-xs" lay-event="delpro"  style="background-color: #557DFF;width: 60px;color:white;">删除任务</a>'
						}
						return result;
					}},{field:'taskid', title:'taskid',hide:true,align: 'center'},
			]]
			,data: tableData
			,even: true
			,done:function (res, curr, count) {
				//***重点***：table渲染完成后渲染element进度条
				element.render();
				table.render();
				nowCurr = curr;
				nowCount = count;
			}
		});
		tabletimer && clearInterval(tabletimer);
		if(nowCount > 0) {
			tabletimer = setInterval(function(){
//	  			  console.log(nowCurr);
//				  tabrender.reload({page: {curr: nowCurr}});
//	  			  refreshProtasktList();
				invoke("getProgress",{},function(data){
					var d = data.respData.data;
					for(var i = 0;i < d.length;i++) {
						var hp = 0;
						if(d[i].modelId=='2'){
							hp = 50*d[i].jd;
						}else{
							hp = 0.14*d[i].jd;
							hp =hp.toFixed(1);
							hp =hp*100;
						}
						if(hp ==0||hp ==10||hp ==30){
							$('#listquery')[0].click();
						}
						if(hp>100||hp==100){
							hp = 100;
							$('#listquery')[0].click();
						}
						element.progress('progress'+d[i].modelId, hp+"%");
					}
					if(d.length==0){
						$('#listquery')[0].click();
					}
				})
			}, 2000);
		}

		table.on('row(test)', function(obj){
//			  console.log(obj.data) //得到当前行数据
			if(obj.data.state != "正在计算") {
				layer.msg('任务未开始，暂无信息', {icon: 2});
				return;
			}
			$('#backstageText').html("");
			backStageTimer && clearInterval(backStageTimer);
			var url = "";
			if(obj.data.modelName == "调度运行模拟") {
				url = 'executive/getProgressInfoYX';
			} else if(obj.data.modelName == "源网储一体化规划") {
				url = "executivegtep/getProgressInfoYX";
			} else if(obj.data.modelName == "dat转换") {
				url = "executivedat/getProgressInfo";
			}
			backStageTimer = setInterval(function(){
				$.ajax({
					dataType: "json",
					data:{planId:obj.data.id},
					url: url
				}).done(function(res) {
					var r = eval("("+res.result+")");
					$('#backstageText').html(r.result);
					$('#backstageText')[0].scrollTop = $('#backstageText')[0].scrollHeight;
				});
			}, 1000);
		});
		//监听行工具事件
		table.on('tool(test)', function(obj){
			var data = obj.data;
			obj.tr.data('off',true);
			if(obj.event === 'delpro'){
				layer.confirm('是否终止计算任务', {
					btn: ['确定','取消'] //按钮
				}, function(){
					delWaitTask(data.taskid);
					layer.msg('已终止计算任务', {icon: 1});
				}, function(){
					layer.msg('取消终止计算任务', {icon: 1});
					obj.tr.data('off',false);
				});
			}else if(obj.event === 'kill'){
				layer.confirm('是否删除计算任务', {
					btn: ['确定','取消'] //按钮
				}, function(){
					$('#backstageText').html("");
					killTasklist(data.taskid);
					backStageTimer && clearInterval(backStageTimer);
					//tabletimer && clearInterval(tabletimer);
					layer.msg('已删除计算任务', {icon: 1});
				}, function(){
					layer.msg('取消除计算任务', {icon: 1});
					obj.tr.data('off',false);
				});
			}
		});
	});
	/*$('.layui-table .layui-table-cell > span').css({'font-weight': 'bold'});//表头字体样式
   // $('th').hide();//表头隐藏的样式
    
    $('.layui-table-header').css('display','none');//页码部分的高度调整
    $('.layui-table-page').css('margin-top','40px');//页码部分的高度调整
*/};
function refreshProtasktHList() {
	var tableData1 = [];
	var H_modelName =$('#H_modelName').val();
	var H_projectName =$('#H_projectName').val();
	var H_planName =$('#H_planName').val();
	if(H_modelName=='模块名称'){
		H_modelName  ='';
	}
	if(H_projectName=='工程名称'){
		H_projectName  ='';
	}
	if(H_planName=='方案名称'){
		H_planName  ='';
	}
	var data1 =  invoke('getRunLog', {modelName:H_modelName,projectName:H_projectName,planName:H_planName}).respData;

	for(var i=0;i<data1.length;i++){
		tableData1.push({"sortNo":data1[i].sortNo,
			"id":data1[i].id,
			"modelName": data1[i].modelName,
			"proName":data1[i].proName,
			"planName": data1[i].planName,
			"starttime": data1[i].starttime,
			"endtime": data1[i].endtime,
			"state": data1[i].state
			,"jd": data1[i].jd})
	}
	layui.use(['table','element'], function(){
		var table = layui.table;
		var element = layui.element;

		table.render({
			elem: '#test1',
			width:1180,
			height:445
			,defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
				title: '提示'
				,layEvent: 'LAYTABLE_TIPS'
				,icon: 'layui-icon-tips'
			}]
			,title: '用户数据表'
			,cols: [[{field:'sortNo', title:'序号', width:'8%',align: 'center'},
				{field:'id', title:'工程名称',hide:true,align: 'center'},
				{field:'modelName', title:'模块名称', width:'15%',align: 'center'},
				{field:'proName', title:'工程名称', width:'15%',align: 'center'},
				{field:'planName', title:'方案名称', width:'12%',align: 'center'},
				{field:'starttime', title:'启动时间', width:'20%',align: 'center'},
				{field:'endtime', title:'结束时间', width:'20%',align: 'center'},
				{field:'state', title:'状态', width:'9.5%',align: 'center'},
			]]
			,data: tableData1
			,even: true
			,page: true
			,done:function (res,currentCount) {
				//***重点***：table渲染完成后渲染element进度条
				element.render();
				table.render();
			}
		});


	});
	/*$('.layui-table .layui-table-cell > span').css({'font-weight': 'bold'});//表头字体样式
    $('th').hide();//表头隐藏的样式
    
    $('.layui-table-header').css('display','none');//页码部分的高度调整
    $('.layui-table-page').css('margin-top','40px');//页码部分的高度调整
*/};


function intBarprogress(){
	layui.use('element', function(){
		var $ = layui.jquery
			,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块

		//触发事件
		var active = {
			setPercent: function(){
				//设置50%进度
				element.progress('demo', '50%')
			}
			,loading: function(othis){
				var DISABLED = 'layui-btn-disabled';
				if(othis.hasClass(DISABLED)) return;

				//模拟loading
				var n = 0, timer = setInterval(function(){
					n = n + Math.random()*10|0;
					if(n>100){
						n = 100;
						clearInterval(timer);
						othis.removeClass(DISABLED);
					}
					element.progress('demo', n+'%');
				}, 300+Math.random()*1000);

				othis.addClass(DISABLED);
			}
		};

		$('.site-demo-active').on('click', function(){
			var othis = $(this), type = $(this).data('type');
			active[type] ? active[type].call(this, othis) : '';
		});
	});
}
function invoke(url, args, callback){
	var r, op = {
		url: 'Sample/' + url,
		type:'POST',
		cache:false,
		async:true,
		dataType:'json',
		data:args ? JSON.stringify(args) : null,
		contentType:"application/json"
	};
	if(typeof callback == 'function'){
		op.success = function(data){
			if(data.error)return alert(data.error);
			callback(data);
		}
	} else {
		op.async = false;
		op.success = function(data){
			r = data
		};
	}
	$.ajax(op);
	if(r)if(r.error){
		alert(r.error);
		return null;
	}
	return r;
};
function invoke_sys(url, args, callback){
	var r, op = {
		url: 'Sysconfig/' + url,
		type:'POST',
		cache:false,
		async:true,
		dataType:'json',
		data:args ? JSON.stringify(args) : null,
		contentType:"application/json"
	};
	if(typeof callback == 'function'){
		op.success = function(data){
			if(data.error)return alert(data.error);
			callback(data);
		}
	} else {
		op.async = false;
		op.success = function(data){
			r = data
		};
	}
	$.ajax(op);
	if(r)if(r.error){
		alert(r.error);
		return null;
	}
	return r;
};